• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[APP][5.0+][ROOT] Toggle Network Type 5.0 (2G, 3G, LTE) (xda-exclusive free version)

How do you use Toggle Network Type 5.0? (Multiple answers possible)

  • Widget

    Votes: 231 48.6%
  • Shortcut

    Votes: 69 14.5%
  • Locale/Tasker plugin

    Votes: 246 51.8%

  • Total voters
    475
Search This thread

cygery

Inactive Recognized Developer
May 6, 2013
1,256
1,480
cygery.com
Hi,

I've developed a widget to toggle (preferred) network types, e.g., 2G, 3G, 2G/3G, LTE, on Android 5.0/5.1 (Lollipop), Android 6.0 (Marshmallow), and Android 7.0/7.1 (Nougat). It requires root.
This is an xda-exclusive free version! If you want to support me, please consider getting the paid version on Google Play or check out my other apps.
Please note: Redistribution of this app is not allowed!

New: Support for dual SIM/multi SIM devices on Android 6.0 and later.

Paid version on Google Play (same functionality): https://play.google.com/store/apps/details?id=com.cygery.togglenetworktype

Device compatibility: second post

Features:
  • Widget (cycle through configurable list of network types)
  • Locale/Tasker plugin (set specific network type or toggle to next)
  • Shortcut (set specific network type or toggle to next)
  • Custom names for network types (text shown on the widget)
  • Custom background image or color
  • Configure text size and color
  • Dual SIM/multi SIM support on Android 6.0 and later

Device Support
Device support depends on a variety of factors, including your specific device model, Android version, installed (custom) ROM, used root provider (su binary), and SELinux configuration. This app includes options to deal with different configurations of some of those factors. Please let me know if this app does not work on your device.

Notes
The widget is passive. Thus, it has to request root every time it is refreshed. Although the battery impact is negligible, this usually results in frequent (Toast) messages indicating that the app was granted root rights. Please refer to your superuser management app if you'd like to disable those messages specifically for this app.
This app includes a (static) shortcut and a (dynamic) widget. Usually, both shortcut and widget are shown in the same list which is used to add them to your homescreen although this list is commonly just labeled "Widgets". For reference, the screenshots in this post show the widget. The shortcut looks like the app icon and has rounded corners. Please note: sometimes the widget is not shown immediately after installing this app. This is likely a bug in the launcher/homescreen app. Please reboot your device in that case.

Known issues:
Android 6/7: When the network type is changed via this app and then the cell radio system settings are opened, the network type is reset to the one set there. Similarly, the previous issue might happen after a reboot or when airplane mode is toggled on and off.
Android 6/7: Some devices/(beta) ROMs don't work with this app (currently). Please search the thread for more details/user reports.
Network type specific: Depending on your device and carrier when using certain modes, e.g., LTE only, you might be unable to send or receive calls, SMS, etc. This is a technical limitation and has nothing to do with this app. Please keep this limitation in mind in case you are not sure whether you are affected by it or not.
Network type specific: Depending on your device/Android version/(custom) ROM/etc. some network types might be unavailable, don't work, or, when trying to select them, result in a different one being activated instead. Please search the thread for more details/user reports. This is outside of this app's control.
Custom ROMs: On some custom ROMs, the default toggle mechanism does not work. There exists a "custom ROM mode" which uses a different method that works on (most) CyanogenMod ROMs and other custom ROMs based on it. However, some network types are not supported by the custom ROM mode. When trying to set them, e.g., the app freezes. Please disable any such unsupported types via the app settings. Additionally, depending on the device/ROM, setting the preferred network type might work, e.g., via the Locale/Tasker plugin or shortcut, but this app might be unable to retrieve the currently set preferred network type. In such cases, toggling to the "next" preferred network type doesn't work since this app doesn't know the current preferred network type.

Other issues: When reporting any issues please include the following info in your post: Device, ROM and ROM version, exact version number of this app you use (don't just write "latest"), superuser management app (e.g., SuperSU) and version, content of any shown error messages. Describe in detail what you tried to do, what you expected to happen, and what happened instead. Include screenshots/screencasts where possible and useful to show the issue.

Cheers,

cygery

Screenshots:

phone_togglenetworktype_1.png
phone_togglenetworktype_2.png


Changelog

v1.2.3.0:
small fixes

v1.2.2.0:
attempt to fix reading of current preferred network type when using custom ROM Mode

v1.2.1.0:
added multi SIM support when using custom ROM mode
fixed toggle state updates when using custom ROM mode

v1.2.0.0:
added multi-SIM support with customizable label in widget
added option to use default SELinux context (makes app compatible with more root providers)
removed support for automatic refreshing on connectivity changes
small fixes and improvements

v1.1.6.0:
added support for Android 6.0
added option to control automatic refresh of toggle state
small fixes and improvements

v1.1.5.1:
fixed: custom ROM mode (network type issue)
improved: custom ROM mode (widget update after toggle)

v1.1.5.0:
added: option for custom ROMs to use different toggle method
small fixes and improvements

v1.1.4.0:
bug fixes
small improvements

v1.1.3.0:
small improvements

v1.1.2.0:
show message if network type switching wasn't successful

v1.1.1.0:
added option to show all network types

v1.1.0.0:
NEW: Material-like design
NEW: customizable text color and size
NEW: custom background
small fixes and improvements

v1.0.4.0:
small fixes

v1.0.3.0:
removed phone hardware requirement

v1.0.2.0:
initial release
 

Attachments

  • com.cygery.togglenetworktype.xda-1.0.2.0.apk
    665 KB · Views: 19,238
  • com.cygery.togglenetworktype.xda-1.0.3.0.apk
    665 KB · Views: 2,280
  • com.cygery.togglenetworktype.xda-1.0.4.0.apk
    665 KB · Views: 1,878
  • com.cygery.togglenetworktype.xda-1.1.0.0.apk
    669.2 KB · Views: 2,952
  • com.cygery.togglenetworktype.xda-1.1.2.0.apk
    670.6 KB · Views: 3,413
  • com.cygery.togglenetworktype.xda-1.1.3.0.apk
    670.7 KB · Views: 2,691
  • com.cygery.togglenetworktype.xda-1.1.4.0.apk
    671.1 KB · Views: 23,590
  • com.cygery.togglenetworktype.xda-1.1.5.0.apk
    757.8 KB · Views: 1,631
  • com.cygery.togglenetworktype.xda-1.1.5.1.apk
    757.8 KB · Views: 12,728
  • com.cygery.togglenetworktype.xda-1.1.6.0.apk
    766.4 KB · Views: 38,558
  • com.cygery.togglenetworktype.xda-1.2.0.0.apk
    808.4 KB · Views: 400
  • com.cygery.togglenetworktype.xda-1.2.1.0.apk
    808.6 KB · Views: 466
  • com.cygery.togglenetworktype.xda-1.2.2.0.apk
    808.8 KB · Views: 1,681
  • com.cygery.togglenetworktype.xda-1.2.3.0.apk
    808.7 KB · Views: 35,187
Last edited:

cygery

Inactive Recognized Developer
May 6, 2013
1,256
1,480
cygery.com
Device compatibility:

Please note: This is not an exhaustive list and only mirrors my current state of knowledge. If your device is neither listed in the "compatible" or "incompatible" list its compatibility isn't known yet. If you test it please report and I'll update the lists.

Compatible:
  • Nexus 5
  • Nexus 6
  • Nexus 6P
  • Nexus 4
  • Samsung Galaxy S2
  • Samsung Galaxy S3
  • Samsung Galaxy S4
  • Samsung Galaxy S4 LTE GT-I9505
  • Samsung Galaxy S4 Mini
  • Samsung Galaxy S5 900F
  • Samsung Galaxy S6
  • Samsung Galaxy Note 3 N900
  • Samsung Galaxy Note 3 N9005
  • SM-N9008V (Resurrection Remix 5.6.0)
  • HTC M8 GPE
  • HTC One S
  • LG G2 D802
  • LG G3 F400
  • LG G4
  • LG Leon H340n / MS345
  • LG Optimus 4X HD (p880)
  • Motorola Moto X 2014 (XT1097)
  • Motorola Moto X 2014 Pure Edition (XT1095)
  • OnePlus One (Bacon)
  • Oneplus X (Oxygen OS 2.13-X)
  • OnePlus 3 (7.0 Oxygen OS)
  • Shield LTE
  • Sony Xperia L
  • Sony Xperia S
  • Sony Xperia Z1
  • Xiaomi Mi2
Incompatible:
  • HTC One (different models affected, reason unknown, might be ROM-related)
  • Moto X X1092 (with Android 6.0)
  • 2015 Moto X Pure Edition [XT1575] (with Android 6.0)
  • Oxygen OS (some devices/versions affected)
  • old/unfinished CM12.1-based ROMs show a "-3" error when trying to toggle (this is a bug in the ROM which in some cases is fixed in more recent releases) workaround added in version 1.1.5.1 ( "custom ROM mode" )
 
Last edited:

kenkiller

Senior Member
Nov 21, 2009
3,437
553
Wonderful. Initial testing seems to work, the network mode in settings change when pressed.

Will this go into the Play Store? Would love to support your effort.

---------- Post added at 12:22 PM ---------- Previous post was at 11:50 AM ----------

Oh yes...this only works on Lollipop? Does it work on Kitkat as well?
 
  • Like
Reactions: ootay and cygery

modyt

Senior Member
Mar 11, 2013
433
180
Mumbai
Hi,

I've developed a widget to toggle (preferred) network types, e.g., 2G, 3G, 2G/3G, LTE, on Android 5.0 (Lollipop). It requires root.
This is an xda-exclusive free version! If you want to support me, please consider getting the paid version on Google Play or check out my other apps.
Please note: Redistribution of this app is not allowed!

Device compatibility: second post

Features:
  • Widget (cycle through configurable list of network types)
  • Locale/Tasker plugin (set specific network type or toggle to next)
  • Shortcut (set specific network type or toggle to next)
Cheers,

cygery

PS: As far as I know, this is the only app/widget allowing you to toggle preferred network types on Android 5.0. Please correct me if this is wrong.

Perfect. Thanks man.

Sent from my Nexus 5

---------- Post added at 10:33 AM ---------- Previous post was at 10:27 AM ----------

Wonderful. Initial testing seems to work, the network mode in settings change when pressed.

Will this go into the Play Store? Would love to support your effort.

+1. Would love to support as well.

Sent from my Nexus 5
 
Last edited:
  • Like
Reactions: cygery

jacknicholson

Senior Member
Jun 23, 2013
555
442
Last edited:
  • Like
Reactions: cygery

kenkiller

Senior Member
Nov 21, 2009
3,437
553
https://play.google.com/store/apps/details?id=com.cygery.togglenetworktype

@cygery I recall seeing some hesitation to post Play Store links in one of your other threads. I'm pretty certain that you'd be fine to do so, as long as a free version is included as well (see: BetterBatteryStats).

That said, y'all should definitely pick this one up. On sale as we speak!
Strange.....was looking/refreshing dev's list of apps and this never appeared.

Bought!
 
  • Like
Reactions: cygery

matthian

Senior Member
May 11, 2009
79
3
Berlin
www.mattidroid.net
Thanks a lot, works fantastic.

If I want to use that with other apps than Locale or Tasker (in my case Lama), what is the Intend I need to use to set the network mode? What is the syntax?

Great job.

Sent from my Nexus 5 using Tapatalk
 

nexxer

Member
Apr 29, 2011
41
7
PowerToggles

Works great as a PowerToggles custom toggle. I only wish its icon would update to show you what mode it's in right now.

Right now I have to also have the built-in "Data Network Toggle" added, which tells you what mode it's in after you click on it.
 
  • Like
Reactions: cygery

kenkiller

Senior Member
Nov 21, 2009
3,437
553
Thanks a lot, works fantastic.

If I want to use that with other apps than Locale or Tasker (in my case Lama), what is the Intend I need to use to set the network mode? What is the syntax?

Great job.

Sent from my Nexus 5 using Tapatalk
Run it as a shortcut, no need to fool around with intents.
 
  • Like
Reactions: cygery

cygery

Inactive Recognized Developer
May 6, 2013
1,256
1,480
cygery.com
Wonderful. Initial testing seems to work, the network mode in settings change when pressed.

Will this go into the Play Store? Would love to support your effort.

---------- Post added at 12:22 PM ---------- Previous post was at 11:50 AM ----------

Oh yes...this only works on Lollipop? Does it work on Kitkat as well?

Strange.....was looking/refreshing dev's list of apps and this never appeared.

Bought!

Thanks! Google Play indeed behaves strange, it (sometimes?) takes several hours until an app is shown on the developer page although it's already visible on its own page. Now everything seems to be there.

The method I used in this app doesn't work on KitKat or earlier, it was introduced in Android 5.0. Although I'm still checking for another way I don't have much hope because many others have searched and I haven't seen that anyone found a method.
 

cygery

Inactive Recognized Developer
May 6, 2013
1,256
1,480
cygery.com

cygery

Inactive Recognized Developer
May 6, 2013
1,256
1,480
cygery.com
Works great as a PowerToggles custom toggle. I only wish its icon would update to show you what mode it's in right now.

Right now I have to also have the built-in "Data Network Toggle" added, which tells you what mode it's in after you click on it.
The widget does this when you click it or when the connectivity changes. As far as I know, it's not possible to update the shortcut icon. Anyway, I abstained from polling the selected network type in case of external changes - it's just a waste of battery.
 

cygery

Inactive Recognized Developer
May 6, 2013
1,256
1,480
cygery.com
Small update (1.0.3.0) which shouldn't affect anyone who downloaded the app from this thread. This update just removed the requirement for telephony hardware from the AndroidManifest. Thus, the app is now visible via Google Play on devices without phone hardware, e.g., tablets with a data modem.
 
  • Like
Reactions: dadam30

kenkiller

Senior Member
Nov 21, 2009
3,437
553
Small update (1.0.3.0) which shouldn't affect anyone who downloaded the app from this thread. This update just removed the requirement for telephony hardware from the AndroidManifest. Thus, the app is now visible via Google Play on devices without phone hardware, e.g., tablets with a data modem.
Will wait for this version to appear on Store.

However running the previous version from this thread on my Shield tablet LTE, none of the network options can be selected i.e. greyed out. Is that a problem?

Edit : installed the latest version, all the options are still greyed out. So didn't work on Shield tablet LTE for now.
 
Last edited:

cygery

Inactive Recognized Developer
May 6, 2013
1,256
1,480
cygery.com
Will wait for this version to appear on Store.

However running the previous version from this thread on my Shield tablet LTE, none of the network options can be selected i.e. greyed out. Is that a problem?

Edit : installed the latest version, all the options are still greyed out. So didn't work on Shield tablet LTE for now.
Thanks for the report, I'm looking into this.
 

cygery

Inactive Recognized Developer
May 6, 2013
1,256
1,480
cygery.com
Will wait for this version to appear on Store.

However running the previous version from this thread on my Shield tablet LTE, none of the network options can be selected i.e. greyed out. Is that a problem?

Edit : installed the latest version, all the options are still greyed out. So didn't work on Shield tablet LTE for now.
I've uploaded a small update (1.0.4.0). Could you please test it?
 
  • Like
Reactions: kenkiller

Top Liked Posts

  • There are no posts matching your filters.
  • 319
    Hi,

    I've developed a widget to toggle (preferred) network types, e.g., 2G, 3G, 2G/3G, LTE, on Android 5.0/5.1 (Lollipop), Android 6.0 (Marshmallow), and Android 7.0/7.1 (Nougat). It requires root.
    This is an xda-exclusive free version! If you want to support me, please consider getting the paid version on Google Play or check out my other apps.
    Please note: Redistribution of this app is not allowed!

    New: Support for dual SIM/multi SIM devices on Android 6.0 and later.

    Paid version on Google Play (same functionality): https://play.google.com/store/apps/details?id=com.cygery.togglenetworktype

    Device compatibility: second post

    Features:
    • Widget (cycle through configurable list of network types)
    • Locale/Tasker plugin (set specific network type or toggle to next)
    • Shortcut (set specific network type or toggle to next)
    • Custom names for network types (text shown on the widget)
    • Custom background image or color
    • Configure text size and color
    • Dual SIM/multi SIM support on Android 6.0 and later

    Device Support
    Device support depends on a variety of factors, including your specific device model, Android version, installed (custom) ROM, used root provider (su binary), and SELinux configuration. This app includes options to deal with different configurations of some of those factors. Please let me know if this app does not work on your device.

    Notes
    The widget is passive. Thus, it has to request root every time it is refreshed. Although the battery impact is negligible, this usually results in frequent (Toast) messages indicating that the app was granted root rights. Please refer to your superuser management app if you'd like to disable those messages specifically for this app.
    This app includes a (static) shortcut and a (dynamic) widget. Usually, both shortcut and widget are shown in the same list which is used to add them to your homescreen although this list is commonly just labeled "Widgets". For reference, the screenshots in this post show the widget. The shortcut looks like the app icon and has rounded corners. Please note: sometimes the widget is not shown immediately after installing this app. This is likely a bug in the launcher/homescreen app. Please reboot your device in that case.

    Known issues:
    Android 6/7: When the network type is changed via this app and then the cell radio system settings are opened, the network type is reset to the one set there. Similarly, the previous issue might happen after a reboot or when airplane mode is toggled on and off.
    Android 6/7: Some devices/(beta) ROMs don't work with this app (currently). Please search the thread for more details/user reports.
    Network type specific: Depending on your device and carrier when using certain modes, e.g., LTE only, you might be unable to send or receive calls, SMS, etc. This is a technical limitation and has nothing to do with this app. Please keep this limitation in mind in case you are not sure whether you are affected by it or not.
    Network type specific: Depending on your device/Android version/(custom) ROM/etc. some network types might be unavailable, don't work, or, when trying to select them, result in a different one being activated instead. Please search the thread for more details/user reports. This is outside of this app's control.
    Custom ROMs: On some custom ROMs, the default toggle mechanism does not work. There exists a "custom ROM mode" which uses a different method that works on (most) CyanogenMod ROMs and other custom ROMs based on it. However, some network types are not supported by the custom ROM mode. When trying to set them, e.g., the app freezes. Please disable any such unsupported types via the app settings. Additionally, depending on the device/ROM, setting the preferred network type might work, e.g., via the Locale/Tasker plugin or shortcut, but this app might be unable to retrieve the currently set preferred network type. In such cases, toggling to the "next" preferred network type doesn't work since this app doesn't know the current preferred network type.

    Other issues: When reporting any issues please include the following info in your post: Device, ROM and ROM version, exact version number of this app you use (don't just write "latest"), superuser management app (e.g., SuperSU) and version, content of any shown error messages. Describe in detail what you tried to do, what you expected to happen, and what happened instead. Include screenshots/screencasts where possible and useful to show the issue.

    Cheers,

    cygery

    Screenshots:

    phone_togglenetworktype_1.png
    phone_togglenetworktype_2.png


    Changelog

    v1.2.3.0:
    small fixes

    v1.2.2.0:
    attempt to fix reading of current preferred network type when using custom ROM Mode

    v1.2.1.0:
    added multi SIM support when using custom ROM mode
    fixed toggle state updates when using custom ROM mode

    v1.2.0.0:
    added multi-SIM support with customizable label in widget
    added option to use default SELinux context (makes app compatible with more root providers)
    removed support for automatic refreshing on connectivity changes
    small fixes and improvements

    v1.1.6.0:
    added support for Android 6.0
    added option to control automatic refresh of toggle state
    small fixes and improvements

    v1.1.5.1:
    fixed: custom ROM mode (network type issue)
    improved: custom ROM mode (widget update after toggle)

    v1.1.5.0:
    added: option for custom ROMs to use different toggle method
    small fixes and improvements

    v1.1.4.0:
    bug fixes
    small improvements

    v1.1.3.0:
    small improvements

    v1.1.2.0:
    show message if network type switching wasn't successful

    v1.1.1.0:
    added option to show all network types

    v1.1.0.0:
    NEW: Material-like design
    NEW: customizable text color and size
    NEW: custom background
    small fixes and improvements

    v1.0.4.0:
    small fixes

    v1.0.3.0:
    removed phone hardware requirement

    v1.0.2.0:
    initial release
    52
    Device compatibility:

    Please note: This is not an exhaustive list and only mirrors my current state of knowledge. If your device is neither listed in the "compatible" or "incompatible" list its compatibility isn't known yet. If you test it please report and I'll update the lists.

    Compatible:
    • Nexus 5
    • Nexus 6
    • Nexus 6P
    • Nexus 4
    • Samsung Galaxy S2
    • Samsung Galaxy S3
    • Samsung Galaxy S4
    • Samsung Galaxy S4 LTE GT-I9505
    • Samsung Galaxy S4 Mini
    • Samsung Galaxy S5 900F
    • Samsung Galaxy S6
    • Samsung Galaxy Note 3 N900
    • Samsung Galaxy Note 3 N9005
    • SM-N9008V (Resurrection Remix 5.6.0)
    • HTC M8 GPE
    • HTC One S
    • LG G2 D802
    • LG G3 F400
    • LG G4
    • LG Leon H340n / MS345
    • LG Optimus 4X HD (p880)
    • Motorola Moto X 2014 (XT1097)
    • Motorola Moto X 2014 Pure Edition (XT1095)
    • OnePlus One (Bacon)
    • Oneplus X (Oxygen OS 2.13-X)
    • OnePlus 3 (7.0 Oxygen OS)
    • Shield LTE
    • Sony Xperia L
    • Sony Xperia S
    • Sony Xperia Z1
    • Xiaomi Mi2
    Incompatible:
    • HTC One (different models affected, reason unknown, might be ROM-related)
    • Moto X X1092 (with Android 6.0)
    • 2015 Moto X Pure Edition [XT1575] (with Android 6.0)
    • Oxygen OS (some devices/versions affected)
    • old/unfinished CM12.1-based ROMs show a "-3" error when trying to toggle (this is a bug in the ROM which in some cases is fixed in more recent releases) workaround added in version 1.1.5.1 ( "custom ROM mode" )
    18
    9
    I'll probably have an Android 7 device for testing in about 1-2 weeks and will look into supporting Android 7 then.
    7
    Here's a first implementation attempt of the new approach to toggle on CM (see attachment). Big thanks to @baudbox for posting the relevant command!
    There's a new option ("Custom ROM Mode") for the alternative mode. Please note that it only supports some network types.
    I've currently no device for testing so if you test it please report your results. There might be some issues, especially with updating the widget after toggling although I did my best to avoid them.