Quick back story before someone tells me to buy an app. =)
I just got an EVO and it chews through the battery fairly quick. I downloaded JuiceDefender to manage my mobile data connection. That seems have worked out fairly well. However, the settings are just very restricted (even on the paid versions).
As of right now I am trying to develop a much more customizable battery saving application. The main thing I am trying to do first be able to enable/disable the mobile data connection at will.
The problem is I can't find any code snippets or articles on how to do this. The only thing I have found is the following. I don't know how accurate this is, but this was all I could piece together browsing developer.android.com
ConnectivityManager cm = (ConnectivityManager) this.getSystemService(CONNECTIVITY_SERVICE);
cm.stopUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, "android.net.conn.CONNECTIVITY_CHANGE");
State state = cm.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState();
textView.setText(state.name());
If anyone can point me to anything that could help, it would be most appreciated.
UPDATE
It appears that the HTC Evo on Sprint does not use APN settings. I tested this by downloading APNDroid and watching it not work. I then made a quick app to dump all APN entries to the screen. That yielded one result and it was for mms.
Looking at the phone info when JuiceDefender is running, I found that the GSRP network is getting turned on and off. This leaves me to believe it is possible to do it through code even though every page I find asking about this same issue says it cannot be done. The kicker is they all say to do it like APNDroid. Please someone give me some insight.
Thanks!