2g/3g switch

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
daarth
Posts: 2
Joined: 21 Jul 2013 14:38

2g/3g switch

Post by daarth » 21 Jul 2013 14:41

There's setting called "enable 2g only to save battery" could be nice to be able to switch this network setting with your app.

jkcaldwe
Posts: 4
Joined: 19 Aug 2013 19:34

Re: 2g/3g switch

Post by jkcaldwe » 19 Aug 2013 19:39

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.

xxx
Posts: 39
Joined: 18 Mar 2013 18:51

Re: 2g/3g switch

Post by xxx » 02 Sep 2013 17:17

Me too.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: 2g/3g switch

Post by Martin » 02 Sep 2013 18:54

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.

Giskar
Posts: 3
Joined: 13 Sep 2013 15:18

Re: 2g/3g switch

Post by Giskar » 13 Sep 2013 15:26

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)

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: 2g/3g switch

Post by Martin » 14 Sep 2013 07:53

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?

Giskar
Posts: 3
Joined: 13 Sep 2013 15:18

Re: 2g/3g switch

Post by Giskar » 16 Sep 2013 08:19

Great thanks. Im out for some days but will test and post you the results asap

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: 2g/3g switch

Post by Martin » 16 Sep 2013 16:13

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.

Giskar
Posts: 3
Joined: 13 Sep 2013 15:18

Re: 2g/3g switch

Post by Giskar » 16 Sep 2013 18:57

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

pilusona
Posts: 39
Joined: 02 Dec 2012 03:47
Location: India

Re: 2g/3g switch

Post by pilusona » 02 Oct 2013 13:33

Hi Martin,
I have tested this on my CyanogenMod 10.1 and it's working perfectly.
Thanks.
Samsung Galaxy Note 8
Android 9.
Non-rooted

Locked