• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help Anyone found a 4g on/off widget?

I don't believe it is going to be possible to create a simple toggle widget unless you root.

I am an Android developer, and I researched this quickly this morning. The reason I don't believe it is possible:

Future-Proofing Your Apps | Android Developers
Technique to Avoid, #2: Directly Manipulating Settings

Strictly speaking this one isn't evil, since this is a change in behavior that we made to Android itself. But we made it because some developers were doing naughty things: a number of apps were changing system settings silently without even notifying the user. For instance, some apps turn on GPS without asking the user, and others might turn on data roaming.

As a result, applications can no longer directly manipulate the values of certain system Settings, even if they previously had permission to do so. For instance, apps can no longer directly turn on or off GPS. These apps won't crash, but the APIs in question now have no effect, and do nothing. Instead, apps will need to issue an Intent to launch the appropriate Settings configuration screen, so that the user can change these settings manually. For details, see the android.provider.Settings.Secure class, which you can find in the 1.5_pre SDK documentation (and later). Note that only Settings that were moved to the Settings.Secure class are affected. Other, less sensitive, settings will continue to have the same behavior as in Android 1.1.

WARNING: Technical mumbo-jumbo
If you look at the Android SDK, your network settings appear to be stored in the Settings.Secure class. In order to change your network mode, you need to be able to write to Settings.Secure, which requires the system key. Developers do not have the system key that Google used to sign the version of Android that is currently on our phones. If you root your phone and download a custom ROM, the developer that created that ROM will have they key he used, and may possibly share it.

Here is the link to the Settings.Secure class in the Android SDK:
Settings.Secure | Android Developers
 
Upvote 0
Upvote 0
@Dubbin1. I'd be happy to swap in your graphic. I think it needs to be 72x72px. (Bonus points for med and low res versions at 48 and 36 px square, resp.)

On a side note, my app's functionality is not significantly different from LTE Switch on the gnex. If there's demand, I could refactor the system's preferences code in such a way to allow a toggle app. I don't know how long it would take to get included in the mainstream android code. I doubt it would make 4.0.3. Maybe 4.0.4. But maybe they'll fix the LTE power draw by then...
 
Upvote 0
CM9 has an option to toggle it from the drop down window. Of course you would have to choose to root the device. Hope this helps...

http://i44.tinypic.com/etbh1l.png

A little OT for this thread, but how is CM9 so far on the Nexus? Any major functionality still missing or stubbed out? I'm kind of itching to try it, but I'm not so sure I want to run an unofficial kang :)
 
Upvote 0
A little OT for this thread, but how is CM9 so far on the Nexus? Any major functionality still missing or stubbed out? I'm kind of itching to try it, but I'm not so sure I want to run an unofficial kang :)

Sorry for the late response, I'm more active on XDA and Rootzwiki but feel free to give me a PM anytime. At this time CM9 is basically a stock rom with a few added features, the only reason I jumped on using it as a daily rom was because I knew that at one point or another in the future it would become my daily rom. Oh to those CM7 Inc memories...

Hope this helps
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones