Here is a little app I've started working on that enables the 2G Only setting automatically when the phone is asleep to save battery.
As always with these kinds of things, I am not responsible if something goes wrong, so use at your own risk.
Working on Android versions since 2.1. I'm using it on my Nexus 4.
The flashable Toggle2G-Update.zip is designed to work with CyanogenMod based ROMs. There is no need to resign any CyanogenMod ROMs.
The easiest way to see if Toggle2G works on your ROM is flash the Toggle2G-Update.zip from the recovery. If your ROM is compatible, Toggle2G will show up in your app drawer.
ONLY IF THAT DOES NOT WORK, then you can try the ResignUpdate java application to convert your ROM. ROMs must be in zip form and be flashable through a recovery like CWM or TWRP. Download the ResignUpdate.zip and read the included readme-first.txt file. Once you resigned your ROM, you then wipe and flash the resigned ROM.
See the troubleshooting section below if you have trouble.
ResignUpdate Change Log:
v3.0.1 - Don't close out of the GUI on certain errors
v3.0.0 - Automatic SecPhone.apk and SecSettings.apk detection | Running ResignUpdate.bat/sh without any parameters pops up a GUI so you can pick the ROM.zip file (Should help with path issues). You can still use the command line options if you want and it will bypass the GUI.
v2.1.3 - Update Toggle2G.apk to v0.2.0.
v2.1.2 - Overrides ROM's Toggle2G.apk when injecting.
v2.1.1 - Bug fix during Toggle2G.apk injection.
v2.1.0 - ZipAlign resigned files.
v2.0.4 - It seems keys need to be physical files..fixed
v2.0.3 - Don't fail on unreadable apks. Sign resigned zip. Move injection files into ResignUpdate.jar so no path issues.
v2.0.2 - Better detection of RSA file in an APK. Some additional optional parameters to help with any fringe cases that might come up
v2.0.1 - Don't change apk's storage method when processing it
v2.0.0 - Initial Release
Toggle 2G Change Log:
Always reboot after an update!
v0.3.5 Added option to always switch to 3G. This is if you want 3G except when on wifi or data off or low battery. / Fixed Spanish translation crashing Toggle 2G. / Start to refer to networks as fast/slow. This is because users might want to toggle from LTE to 3G.
v0.3.4 Fixed bug that was switching back to 3G
v0.3.3 Enable data in auto swich mode will reactive 3G
v0.3.2 Fix retry of network change when data off setting is used
v0.3.1 Fix bug when toggling data that was preventing the Manual Notifications from working.
v0.3.0 Added LTE networks and removed the need for ROOT (You will need to re-setup Toggle2G after upgrade)
v0.2.4 New icons from LeopardSurd. Show version number at top of Toggle 2G settings screen.
v0.2.3 Try for 5 seconds to get network to switch after data turning off data. I hope this helps with switching on phone like the Galaxy S II; German translation thanks to Aiakio; Italian translation thanks to krinet
v0.2.2 Fixed bug where sometimes network would switch to the same network causing data to disable then enable
v0.2.1 Fix some issues with not switching.
v0.2.0 Option to wait for phone unlock before switching to 3G; Option to turn data off to switch networks; Option to switch to 2g when data is off; French translation thanks to mooondark
v0.0.20 Set SDK to v8 to fix compatibility with CM6
v0.0.19 Updated German using the translation from Aiakio.
v0.0.18 Added translations by muchopoli83. (Danish, German, Spanish, French, Hungarian, Italian, Portuguese, Russian, and Chinese)
v0.0.17 Tweaked chmod on preferences folder
v0.0.16 Switch to 2g when data is disabled. Better fix for bug where settings are not surviving a reboot.
v0.0.15 Fix bug where settings are not surviving a reboot (I hope). New icon from hawkeyexp, thanks!v0.0.14 2G when sleep on/off option, 2G Notification fixes/options, Options reworked
v0.0.13 Option to not switch to 2G if network is being used. Default threshold of 2 KBps means 2G will not enable if >= 2 KBps is being used. Threshold is configurable in settings
v0.0.12 You can pick a specific network through the Tasker/Local plug-in (not just 2G or 3G) / Battery feature can be turned off / Disable options only applicable to auto manage when its off
v0.0.11 Delay switching to 2G when wifi is turned on to prevent network outage during transition. Also added option to off the feature that switches to 2G when using wifi.
v0.0.10 Fix bug that was not changing auto manage
v0.0.8 Customizable network selections for 2G and 3G modes.
v0.0.7 Added home widget. The Toggle 2G plug-in app is needed to use the widget.
v0.0.6 Option to allow user to choose when to switch back to 3G using the notification bar. Requires a separate plug-in app attached here or from the market
v0.0.5 more fixes to try and prevent switching when phone rings and phone wakes up
v0.0.3 fix issues with disconnecting incoming call
v0.0.2 adds Tasker/Locale plugin support!
Automatic Mode Features:
- Switch to 2G when wifi is connected.
- Switch to 2G when data is turned off.
- If screen is off for more that 10 minutes (configurable in the app) it will switch to 2G
- If screen is off and battery is below 30% (configurable in the app) it will switch to 2G
- Network usage monitoring to prevent switching to 2G if network is being used.
- 3G can be re-enabled as soon as the screen is turned on or unlocked or it can be done manually
- Option to Disable data before switching network. (Required on some phones/ROMs)
- Option for manual switching back to 3G. This setting allows user to choose when to switch back to 3G by selecting a notification in the notification bar. Requires separate app located on market or use link below
- Runs in the com.android.phone process to gain access to the 2G Only setting.
- Shares process with system so installing will list pretty much all of the permissions
Uses root access to save preferences, seems running in the com.android.phone process can causes some problems with creating a preferences folder to hold the preferences file. Root access is needed to save preferences.I have a new system for saving preferences that does not need root. However, as a backup, if Toggle2G fails to use the new system it will fall back to this old system and use Root, (I didn't want to break it for phones I can't test on)
- Does not change network while in a call. Otherwise the call will drop because the radio resets. (Even if Tasker/Locale tells it to)
- Changing network can be slow. You may have to wait a second for 3G to reactivate. I suggest using the manual switch to 3G option and plugin if this is the case.
- Due to issues with how Toggle 2G uses a shared user id, I've implemented the notifications and home widget under a separate app.
- 3 settings for the Tasker/Locale plugin and home screen widget. Automatic, 2G , or 3G (Setting 2G or 3G disables auto mode)
- Don't switch to 2g while tethering
disable the 3g when the reception is between ___ and ___ to keep it from flip-flopping.(Can't be done, you can't monitor 3G reception levels while in 2G) Use g sensors to detect movement and reactivate 3G to lower radio down time after unlocking phone(Monitoring these sensors would drain battery and defeat the purpose)
If you think of a feature or find a bug, let me know.
Also, I've attached a values.zip file so that everyone can contribute to translating Toggle2G to other languages.
I'm a code junkie, please support my habit
SOURCE CODE IS AVAILABLE HERE:
Toggle 2G Source
Toggle 2G Plugin Source
* Make sure you have Java 6 or higher installed
* I get an "Failed to find any apk with a key" error when signing my ROM
If you get this error it means that ResignUpdate tool could not find one of these files in the ROM's zip file:
At lease one of these files is needed to identify what in the ROM needs to be resigned. You can open the ROM's zip file and try and find where one of these files are. If you find it in a folder other than system/app you can specify one of these files in the -keyapk parameter when running ResignRom. For example, if you find that the SecPhone.apk is actually in the preload/symlink/system/app folder, then put preload/symlink/system/app/SecPhone.apk in the -keyapk parameter.