[Touch CDMA Android Development] grktaurus83:
Well, the moment (or at least

a

moment) you all have been waiting for.

Dial-on-Demand for Android!

INSTALLATION INSTRUCTIONS:

=======================

1)

MAKE A BACKUP COPY OF YOUR data.img, system.img, AND initrd.gz!

I've had to restore my files from backups quite a few times while making this work. While I'm not sure if it's because of this script or all of the other tinkering I've been doing, it's better to be safe than sorry!

2) Download the "initrd.toggle.v##.gz" I've made from here.

3) Rename the "initrd.toggle.gz" to "initrd.gz" and replace your "initrd.gz" with it.

4) That's all.

USAGE:

======

1) Boot into Android without an internet connection. Android will not establish an internet connection automatically with this initrd.gz. I have it set that way because I want the connection off unless I specify otherwise.

2) Toggle your internet on/off using the toggle.sh script by going to "Dev Tools > Terminal Emulator" and runing:

su
/toggle.sh

This will echo whether it is turning the connection on or off. If your connection is currently up, toggle.sh will bring it down. If your connection is down, toggle.sh will bring it up. Simple.

Please give the script at least 20 seconds to make sure the connection comes up. You can check the connection by typing:

su
/bin/ifconfig

and you should see an entry that starts with ppp0 with an IP that is NOT 127.0.0.1. Also, using the maps application is a good indicator of whether or not the connection is working.

NOTE!

=====

Don't panic if you toggle your connection on and your internet does not work!

This happens!

Even though you see the ppp0 entry in ifconfig and it has a valid IP, sometimes Android just doesn't recognize that the connection is there. Simply toggle your connection off again, wait 5 seconds, and toggle it back on. (This usually happens the first time you toggle your connection on.) This has always solved the problem for me.

Martin, let me know how this works for you. I've set this up so that it basically exploits your setupmodem service loop and forces setupmodem.sh to sleep until toggle.sh is called. This should reduce power usage a bit.

Also, can someone run this build without using the internet for a whole day to see how much battery you're left with at the end of the day? I know this is a ****ty request since this build is all about getting the internet WORKING, but I'd like to know how the battery is affected by these changes. I will be testing this myself, but I don't want to make this result just isolated to my case.

Let me know how this works out for you guys. I've spent ridiculous amounts of time (anywhere between 3 and 12 hours a day, at least 2) the last two weeks has been leading up to this, so I hope it works for everyone.

Edit: Currently, if you try to toggle the connection on and you have no service, the script will keep trying until the connection comes up. This will probably drain the battery. I haven't built in any error tracking for the script, so it doesn't know how many times it has failed and to just stop trying. I will be implementing this in the next few days. So if you notice that your connection is not coming up, make sure to toggle the connection off so it stops trying.