Page 1 of 1

2g/3g switch

Posted: 21 Jul 2013 14:41
by daarth
There's setting called "enable 2g only to save battery" could be nice to be able to switch this network setting with your app.

Re: 2g/3g switch

Posted: 19 Aug 2013 19:39
by jkcaldwe
Me Too.

I would like to be able to toggle each data network type based on a trigger or condition.
Example: When YouTube (or other data heavy app) is not active turn off 3G and 4G to save battery. When YouTube is opened, turn 4G back on.

Re: 2g/3g switch

Posted: 02 Sep 2013 17:17
by xxx
Me too.

Re: 2g/3g switch

Posted: 02 Sep 2013 18:54
by Martin
Android does not provide an API to switch the 2G/3G settings on a regular Android ROM. Cyanogenmod seems to support such an API and it's on my list of features under consideration for a future release.

Re: 2g/3g switch

Posted: 13 Sep 2013 15:26
by Giskar
Please consider to raise its priority as i think many people look into this kind of programs just trying to improve battery life and this is a basic feature as switching to 2G when no internet is needed (only for notifications/messages) is a huge improvement. By the way im not usig cyanogen mod but paranoid android so the way it work in one may not work in the other but... who knows :). May be you can start asking in XDA forums if there is an easy way to do this in the more common ROM's (not trying to tell you how to do your work, just an idea)

Re: 2g/3g switch

Posted: 14 Sep 2013 07:53
by Martin
If you have a rooted device you can try to switch 2g/3g on modified ROMs with following action (use at your own risk):
switch to 2g: Execute Root Command: am broadcast -a com.android.internal.telephony.MODIFY_NETWORK_MODE --ei networkMode 1
switch to 3g+2g: Execute Root Command: am broadcast -a com.android.internal.telephony.MODIFY_NETWORK_MODE --ei networkMode 0

on some other ROMs:
switch to 2g: Execute Root Command: am broadcast -a com.android.phone.CHANGE_NETWORK_MODE --ei networkMode 1
switch to 3g+2g: Execute Root Command: am broadcast -a com.android.phone.CHANGE_NETWORK_MODE --ei networkMode 0


Following values for networkMode seem to exist (but can vary depending on ROM, manufacturer etc.):
  • 0: WCDMA preferred
  • 1: GSM only
  • 2: WCDMA only
  • 3: GSM auto (PRL)
  • 3: CDMA auto (PRL)
  • 4: CDMA only
  • 5: EvDo only
  • 6: GSM/CDMA auto (PRL)
  • 7: LTE/CDMA auto (PRL)
  • 8: LTE/GSM auto (PRL)
  • 9: LTE/GSM/CDMA auto (PRL)
  • 10: LTE only
Is this working on your ROM?

Re: 2g/3g switch

Posted: 16 Sep 2013 08:19
by Giskar
Great thanks. Im out for some days but will test and post you the results asap

Re: 2g/3g switch

Posted: 16 Sep 2013 16:13
by Martin
I have also added a new action to the EAP-version.
The new action does not require root but a modified ROM (like CyanogenMod) since stock Android does not allow to switch this setting by third party apps.

Re: 2g/3g switch

Posted: 16 Sep 2013 18:57
by Giskar
Awesome. Thanks again just came to post a quick and successful test with the root commands and you have done it :-) by the way the new action is also working on my n4 with paranoidandroid
Thanks again and keep up the good work

Re: 2g/3g switch

Posted: 02 Oct 2013 13:33
by pilusona
Hi Martin,
I have tested this on my CyanogenMod 10.1 and it's working perfectly.
Thanks.