yashsingh1/xdaforums huggingface dataset:
[Touch CDMA Android Development] Bad Sector:
Problems running Android Version that saves files to SD

Since the Android version that allows saving files to SD cards came out, i have been unable to get the Android GUI to boot.

it says that it cannot find '/System/bin/sh'

Also it creates two files.. a System and a Data that are 64 megs..

But it never launches into the gui.

and I believe the first error (sorry it scrolls by FAST) is that it is unable to find "/SD Card/System" or something to that effect.

I reformatted the card (1 gig) to FAT 32 and only put on the latest extracted files from 11-19-08.

Can anyone help me out w/ this problem? Or is this a SD problem now?

I will attempt to load it on a 512 meg card I have when I get home.

Thanks,

Bad Sector
[Touch CDMA Android Development] etiger13:
Have you tried formatting it in Linux? Performed a low level format?
[Touch CDMA Android Development] xgumbyx:
etiger13

I'm not the OP that you responded to. But I can confirm that Linux also can not format the card. fsck will say it formats the card sometimes, but when you mount the card again all the data is still there.

I think we are starting to realize the fact that when SD cards are used past a certain point they start to fail.
[Touch CDMA Android Development] jaredakelly:
why can't this just be loaded to the device so we don't get it to keep failing on the sd card
[Touch CDMA Android Development] derekwilkinson:
I think it's because of how large it is....
[Touch CDMA Android Development] dzo:
It's because we don't have a bootloader, one thing that may work is to put the data image onto the nand flash. As for dead SD cards, I have probably written to my card more than anyone and have never had a problem, perhaps it's just some brands. I bet it will also happen on the G1 since it has the same hardware.
[Touch CDMA Android Development] xgumbyx:
The G1's OS doesnt write to its SD card though. Big difference between constant use of memory/swap on an SD card and on the rom itself
[Touch CDMA Android Development] smopoim86:
I've started a post to keep a database of cards that have failed. Maybe we will see a trend in brands or something.

If you have had a card die or currupt to an unuseable state, please post here
[Touch CDMA Android Development] unsungboxer:
Agreed, I am using a Sandisk 2gb card, and have reformatted it numerous times, as well as run every release of Martin's port. Martin has done everything he can to reduce wear to your memory card. But ultimately its try at your own risk.

Writing Android to device memory is not a good option yet. At this point I think all this talk about memory cards is taking the discussion way off topic. Lets refocus our efforts on camera, keyboard, resolution, etc.
[Touch CDMA Android Development] xgumbyx:
Sandisk 4Gb card here. Its not formatting thats the issue. Its the constant writes to the same location of the card over and over and over again. Dont get me wrong, I am not complaining or blaming anyone/thing in a negative way. its just a fact. MicroSD cards wear over time.
[Touch CDMA Android Development] ChickenSoda:
I've installed Android straight to the phone without using the SD card. It runs fine on my Sprint Touch. I recently went over to SD card mode to save space on my internal. Crossing my fingers that it doesn't fry. I'm only using the 512MB that came with the phone, though. Don't need to save a lot of crap on it.
[Touch CDMA Android Development] ahmado78:
Dialer Skin

Hey thanks for all the work guys, I wish I knew more then just installing CABS. But how can I get my dialer to look like that? Right now mine is still scrunched up, I have the most updated Android verison also, and still scrunched. Thanks again guys.
[Touch CDMA Android Development] brunes:
No, it isn't. All SD cards (and all flash) have wear-leveling software built into them that constantly moves sectors around on the card. You are not writing to the same place over and over so that is not the issue.

I also have not had any problem with my card.

You mention you have a 4 GB card - this means it is not an SD card but an SDHC, perhaps that is the difference, people who use SDHC cards have issues and people who use SD cards do not. My 2GB card is not SDHC I don't think.
[Touch CDMA Android Development] tErbo b00st:
not true. I had a 2gb SD card and it went bad (I assume because of android). I have since gotten a 4gb sdhc card, been using it for about a month or so with no problems so far *crosses fingers*
[Touch CDMA Android Development] bugzy:
I have a Transcend 2GB MicroSD (non-SDHC) i think

never killed my SD card yet, but i have had windows tell me to scan for corruption

but it still works
[Touch CDMA Android Development] tErbo b00st:
How did you do this? Just put all the files straight in the phone? I would much rather do this.
[Touch CDMA Android Development] grktaurus83:
Holy ****...

If I did what I think I just did, I may be making quite a few sprint users happy....

I probably should be patient and verify this before saying anything... but I couldn't help but post while the phone is rebooting into Windows Mobile. Just gotta test it a few times to make sure...

Here's to hoping.....
[Touch CDMA Android Development] grktaurus83:
Well...

I'm going to call this tentatively verified!

Starting out with no internet connection in Windows Mobile, I boot into Android with a working internet connection.

My only problem with this is that I can't turn it off. Even though I try to kill the connection using

/bin/ifconfig ppp0 down

the connection stays up. The entry in ifconfig does go away though, but my internet still works.

I'm guessing it's because either Android or Martin has it set up so that it continually tries to connect if it doesn't have an internet connection. Either way, there should be a relatively easy way to fix this.

It would be very nice to be able to turn the connection on and off at will...

Sorry for not providing any information as to how to do this, I need to look through all the changes I've made (and unmade) to see what the result is. I will try to have this info out sometime in the next few hours. Sorry about the delay.

Edit: Oh, just wanted to mention that I didn't do this on my own. I had Martin's help through this whole process (telling me what commands to run and where to look). Thanks a lot Martin!
[Touch CDMA Android Development] xDarKnighTx:
great job! this and the camera was the only two things holding me back from fully using android!
[Touch CDMA Android Development] grktaurus83:
So just to give you guys a little update.

I'm trying to verify which of my changes is responsible for what I found as working results. To do this, I'm starting from a clean 11-19-2008 build and going through a process of elimination.

Unfortunately I wasted an hour because I had the 11-16-2008 build on my desktop and I was accidentally using that instead the 11-19-2008. *sigh*

So far, things are going as expected. Should be about another hour or so before I know for sure.
[Touch CDMA Android Development] retrobits:
new setupmodem.sh

did a su, copied setupmodem.sh to / and did a chmod 4577 on it.

when I execute it, the first thing that is printed is:

busybox: not found

after that the initialising modem message and userid/pwd, sleeping for 15 seconds, and DONE!

then the ifconfig dumps out with the local loopback ip. no connection.

I must be doing something wrong. Cant figure out why busybox sh gives a "not found" (I am assuming its that line of the script) at the beginning, when the last busybox sh command seems to work. Maybe its not finding busybox before the PATH is updated. Are you getting "busybox: not found" at the top of your script as well?
[Touch CDMA Android Development] Macropoutsis:
Hate to be the one with the noob questions, but where is this being edited at? I've been following the posts, but can't figure out where the .sh is. Sorry, can someone shed some light.
[Touch CDMA Android Development] gazpachoking:
I don't think you are doing anything wrong. grktaurus83 reports the same behavior in the post before yours. He said that it works when it is run on bootup though, just not when run manually.
[Touch CDMA Android Development] tlang1982:
question

So I have followed all instructions and it boots linux, shows me the lovely penguin, then goes to a black screen with the word ANDROID and a blinking "_"

and i've let it sit for 30 mins and still nothing after that.

What am i doing wrong?
[Touch CDMA Android Development] Macropoutsis:
You did place data & system files in root of your sd card?
[Touch CDMA Android Development] tlang1982:
yes and the rest is in /sdcard/program files/android/
[Touch CDMA Android Development] Macropoutsis:
I imagine you've soft reset and tried launching again?
[Touch CDMA Android Development] Macropoutsis:
That would be great. I'm not sure if I can access. I'm running windows xp.
[Touch CDMA Android Development] derekwilkinson:
Put them all directly on the SD Card, not in subfolders.
[Touch CDMA Android Development] grktaurus83:
So you guys can find the modified initrd.gz at:

http://prometheus.usc.edu/initrd.gz

This is the 11-19-2008 initrd.gz file with a modified setupmodem.sh file (changes listed here) as well as an extra line to add your PPPUSER name to the /etc/ppp/options.smd1 file.

Fun fact of the day:

For some reason,

echo "text" >> file

does not append the text to the end of the file when used in a script in Android. Well, at least the script I wrote wouldn't do it. It would just overwrite the file as if a > was used instead of >>. Random. So I had to figure out another way to do it.
[Touch CDMA Android Development] grktaurus83:
One thing I'd like to have tested with the changes I've made for Sprint users is what happens when service is lost. I want to know whether the internet connection comes back up when we get service again or not (since the script doesn't work if you run it manually).

Unfortunately, there isn't really a way for me to test this as I have pretty good reception at my place.
[Touch CDMA Android Development] tlang1982:
so i put everything in the root and still no luck. So then I tried just using the default.txt that came with the original zip file (for sprint) and changed nothing. When I did that it got past the andriod but only listed some text something about "android power wakeup" and just does the same thing over and over.

here's what my previous default.txt looked like: by the way i'm a uscellular customer on the 3.42.30 radio

set RAMSIZE 0x08000000

set MTYPE 1667

set KERNEL zImage

set initrd initrd.gz

set cmdline "ppp.username=3192130605@uscc.net ppp.password=3192130605 console=ttyMSM0"

boot
[Touch CDMA Android Development] qwho:
so grktaurus83, do we use username / sprintpcs.com, or just sprintpcs?

and do we just have to put that in the default.txt?

Also, would you be willing to create us a sprint version for each new build that comes out?

Thanks

edit: looks like just sprintpcs works.
[Touch CDMA Android Development] grktaurus83:
Are you sure you're using the 11-19-2008 files? Check the OP and go to dzo's web page and download the "latest" files. Put all of the files in the root of your card and try again. I don't have the "console=ttyMSM0" in my file.

As I said in my long post, it doesn't really matter what username you use, as long as one exists (or else the pppd command fails because there aren't enough arguments for the name parameter).

Also, I changed the initrd.gz that I put up a few hours ago. I replaced the initial "busybox sh" command (which fails) with a "sleep 1" and it works just fine. Without a command before export, my connection is random. Sometimes it starts, sometimes it doesn't. Weird.
[Touch CDMA Android Development] tlang1982:
i redownloaded the files and placed them in the root of the sd card and my default.txt i got rid of the "console=ttyMSMO". It ran MUCH quicker and I think i'm getting closer but i still get "android power: wakeup" with some numbers.

by the way I really appreciate everyones help
[Touch CDMA Android Development] retrobits:
grktaurus83, just tried and your initrd.gz works great. Data connection is initiated on boot. I will test to see what happens when connection drops. Thanks for all your hard work
[Touch CDMA Android Development] Macropoutsis:
Tried your initrd.gz file, works very nice. Thanks for your help & hard work. Funny thing, when I'm running WM, I drop service in certain areas of my home. So I figured I would test to see if I can reconnect. I can't get service to drop when in android. I'm not sure if radio reception is better when in android or what. But will keep trying. Thanks again.
[Touch CDMA Android Development] etiger13:
Try updating your radio. I dont have instructions handy but if you search you might be able to find them.
[Touch CDMA Android Development] Macropoutsis:
One thing I did notice, there seems to be constant activity with the connection even when phone is idle. It ate a fully charged battery in two hours.
[Touch CDMA Android Development] grktaurus83:
I think that's because I changed the delay at the end of the script. It used to be 30 seconds, and I made it 15. I thought the sleep at the end of the script was there to give the connection enough time to establish but I've now realized that this script is in a constant loop. I took off the delay at the end, and I saw this script run 3-5 times during boot before it went to the blinking android script.

I will create another initrd.gz file with a 10 minute delay at the end of the script. Hopefully this will help battery usage a little bit (but probably not much).

Would you guys mind being my test base while I try to figure this stuff out?
[Touch CDMA Android Development] grktaurus83:
So here are some more updates:

I've gotten to the point where I can establish an internet connection manually. I boot into Android with a setupmodem.sh that I know will not establish a connection, verify that the connection is not up, and then run another script that actually brings up the connection.

The problem: Android does not recognize that the connection exists!

I know the connection works because I've tried pinging a known IP before and after running my connection script and it fails before the script and pings successfully afterwards. Both the browser and the maps application do not recognize that there is an active connection available (haven't tested other applications).

This leads me to one primary conclusion: Android seems to channel all of it's internet requests through the setupmodem service, so only that service matters. If we could find a way to communicate with that service (by specifying an on/off state or being able to start/stop the service) we could turn it into a full dial-on-demand connection.

Any thoughts Martin?
[Touch CDMA Android Development] grktaurus83:
This post is for some extra details regarding the previous post. It's more for Martin's sake, anyone else attempting this problem, or the truly curious.

This is the setupmodem.sh script I used to ensure that the connection will not come up but that the service will continue to run.

#!/system/bin/sh
export PATH=/bin:/system/bin
echo ""
echo "Initialising Modem:"
echo "==================="
echo ""
/system/bin/setprop ro.radio.use-ppp no
/system/bin/setprop ro.config.nocheckin yes
PPPUSER=`grep -o "ppp.username=.*" /proc/cmdline | cut -d" " -f1 | sed -e "s/ppp.username=//g"`
PPPPASS=`grep -o "ppp.password=.*" /proc/cmdline | cut -d" " -f1 | sed -e "s/ppp.password=//g"`
echo "$PPPUSER * $PPPPASS" > /etc/ppp/pap-secrets
echo "$PPPUSER * $PPPPASS" > /etc/ppp/chap-secrets
grep -v "^name " /etc/ppp/options.smd1 | sed '$a'"name $PPPUSER" > /etc/ppp/options.smd1
echo "Username=$PPPUSER"
echo "Password=$PPPPASS"
echo ""
echo "DONE!"
echo ""
sleep 300

I basically removed any attempts at starting the connection, but made sure that it set up all the username/password information properly.

The script that actually brought up the connection was:

#!/bin/sh
/bin/sleep 1
/bin/echo ""
/bin/echo "Initialising Modem:"
/bin/echo "==================="
/bin/echo ""
PPPUSER=`/bin/grep -o "ppp.username=.*" /proc/cmdline | /bin/cut -d" " -f1 | /bin/sed -e "s/ppp.username=//g"`
PPPPASS=`/bin/grep -o "ppp.password=.*" /proc/cmdline | /bin/cut -d" " -f1 | /bin/sed -e "s/ppp.password=//g"`
/bin/echo "$PPPUSER * $PPPPASS" > /etc/ppp/pap-secrets
/bin/echo "$PPPUSER * $PPPPASS" > /etc/ppp/chap-secrets
/bin/grep -v "^name " /etc/ppp/options.smd1 | /bin/sed '$a'"name $PPPUSER" > /etc/ppp/options.smd1
/bin/echo "Username=$PPPUSER"
/bin/echo "Password=$PPPPASS"
/bin/echo ""
/bin/sleep 2
/bin/cat /initmodem1 > /dev/smd0
/bin/sleep 2
/bin/cat /initmodem2 > /dev/smd0
/bin/sleep 4
/bin/pppd /dev/smd1
/bin/echo "Sleeping for 10 seconds..."
/bin/sleep 10
/bin/echo "DONE!"
/bin/ifconfig

Only thing that was really adjusted was that I removed the setprop commands (since that's taken care of by the setupmodem.sh script) and increased the time delays between the initcalls and pppd command. I also removed the pppd parameters so it just uses the options.smd1 file (or at least I'm assuming that's what it uses if no parameters are given).

Also, I disabled the setupmodem service once and the browser would only crash whenever I started it up. I enabled it again, but could never get the browser to work again (even after several boots). I had to go back to a previous data.img and system.img. Not sure if the two actions are linked, but I'll be testing it again later to verify.
[Touch CDMA Android Development] retrobits:
Another observation that may help... or may just confuse things further.

Today, using the sprint initrd.gz from grktaurus83 I noticed that the connection had dropped. Just to try it, I manually ran grktaurus83's setupmodem.sh (first version posted several pages back) from dev tools -> terminal. Amazingly enough, it worked! ifconfig dumped out my stats and I was able to use the internet again.

The script doesn't work when I don't use the new initrd.gz. I can only guess at reasons. Possibly the hardware/drivers (or something) needs to get setup at boot for them to work later on, or for the apps to recognize the connection.
[Touch CDMA Android Development] Macropoutsis:
Yea, I'll test. Post it.
[Touch CDMA Android Development] grktaurus83:
I have an idea that I'm going to start implementing in a little while. If it works, I should have a test for you guys in a few hours. We'll see.
[Touch CDMA Android Development] jim256:
Ok, sorry, but just for clarification for us sprint users...

1. Dl the newest 11-19-2008 android files, and place them accordingly on the device.

2. Dl your initrd.gz, and replace the initrd.gz that was contained in the 11-19-2008 package.

3. Change default.txt to include username/password.

3. Boot Android...?

The reason I ask is, I tried this with no go.

I have my username setup as the login/username that I use when trying to log-in at sprint.com, as well as my password.

Thanks for this! Truly awesome if we can get it to initiate on demand and to also die to save battery etc...thanks.
[Touch CDMA Android Development] grktaurus83:
Yea, that should work. I've tested it a few times and it doesn't matter what you use for your username/password. The only requirement is that you do specify a username (I'm using "blah"). I just leave my password blank. Try that and see if it works for you.
[Touch CDMA Android Development] jim256:
Kk will do thx.

EDIT: worked great lol. Thx, that's all I changed.

Sounds awesome, can't wait. Could this possibly be on-demand dialing? ;)
[Touch CDMA Android Development] sfleury:
Works on Bell too...

Thanks, grktaurus83!

I'm on Bell Mobility and your new setupmodem scripts works for me too!

Steve
[Touch CDMA Android Development] grktaurus83:
Awesome! Hopefully it works with Martin's carrier too. If it does, he may implement it into the next release.

Great! Really glad that worked for you.

This little idea is turning out to be trickier than I originally thought. *sigh* I'm not in the debugging phase. Not sure how long it'll take though. Haha.

Edit: Woops. I meant to say I

was

in the debugging phase. So it looks like I have it working, but now the dialer crashes on me like 5 seconds after it opens. Weird... back to debugging.

Edit Again: So just replacing the the system.img and data.img fixed that problem. Now I'm just doing a bit more testing before unleashing this thing on you guys.
[Touch CDMA Android Development] zkush:
how can i tranfer my contacts and sms from winmo to android?

how can i tranfer my contacts and sms from winmo to android?
[Touch CDMA Android Development] grktaurus83:
To migrate your contacts, look around page 177ish. It's all covered around there.

As for sms, I don't think you can.
[Touch CDMA Android Development] qwho:
The connect string you posted the first time seemed to work great for me. I left it on forever and every time I went to use the net it worked...

Hopefully you are right and it will work for martin, that would be nice to not have to worry about a different build every time he releases a bug fix or new functionality...

So really, with the camera on the horizon, the only things left are gps and bluetooth.
[Touch CDMA Android Development] tErbo b00st:
Correct, we REALLY need headphone support. That really is the only thing stopping me from using it 24/7. I can live w/ out GPS, bluetooth, and camera...but I need to listen to my music!

Also, I have been looking around and it seems as though my desktop doesn't match up with what a lot of actual android desktops looks like. Mine looks like this (I assume all of ours do)

but some other screens I have seen look like this
[Touch CDMA Android Development] unsungboxer:
2nd pic is an old version of android sdk. if you really like it you can dl it on martins page
[Touch CDMA Android Development] tmorris52:
New as hell to this

I am extremely new to this. I want to make sure I am doing the right thing. I am downloading the latest update file. I saw that I will need to download another file that starts with an H but I am not for sure if all I need is the update or I need both. Also if there is anything else besides those tow that I will need. Just want to make sure I am on the right track. Thanks.
[Touch CDMA Android Development] craig0r:
And headphones, and marketplace, and a method to save the Voicemail number (either SIM emulation, or altering how the VM number gets saved, i'm guessing) and youtube. :D

I'm guessing headphones will need a USB driver... and a USB driver is fairly necessary if we're going to truly use android 24/7. Otherwise the only method of putting files onto the device would be to download them via CDMA, which would be slow and annoying if all we wanted to do was put some music on the card.
[Touch CDMA Android Development] brunes:
I am Bell as well - how do I get the PPPUSER and PPPPASS ?
[Touch CDMA Android Development] mapiualuta:
Google Sync

Does anyone have syncing to Google Contacts or Google Calendar working? I can login via Dev Tools->Google Login Service->Require Google, but I get no syncing.
[Touch CDMA Android Development] qwho:
hadn't tried headphones with android, I didn't realize they weren't working.

I assume marketplace will come with the full version when we are no longer using the SDK version... I'm assuming that the use of the SDK until now is just to get it running right, then is it simple to put all this work toward the real version of android?
[Touch CDMA Android Development] pierrechn:
hello i am new here..i just bought a HTC Touch 6900 for sprint about 2 weeks ago...i came here and saw you could run Android on the device...but i dont know at all what 2 do..i tried the steps on the 1st page but they dont work for me..it says partitian not found or something

so can somebody make a easier step by step for so i can get this running today thx..links would be appreciated...
[Touch CDMA Android Development] ingenue007:
maybe a better keyboard? a vertical one? (btw does anyone's t9 or auto correction work for spelling?)

also, thanks to the poster for fixing sprint!!
[Touch CDMA Android Development] bugzy:
just did this

hopefully after couple hours, i can still use the internet ;)