Post your questions and help other users.
Moderator: Martin
-
fede91it
- Posts: 19
- Joined: 10 Jan 2014 08:59
Post
by fede91it » 10 Jan 2014 09:25
I have a stock jelly bean rom for my nexus s and I want to switch 2G/3G without using the Control UI action.
Surfing on the internet I have found a couple of methods I can use to do this switch but no one of this works, what I do wrong? (examples to switch to 3Gl)
- am broadcast: (as seen here)
am broadcast -a com.android.phone.CHANGE_NETWORK_MODE --ei networkMode 0
- sqlite3: (as seen here)
sqlite3 /data/data/com.android.providers.settings/databases/settings.db
insert into global values(null, 'preferred_network_mode', 0);
.exit
With
am broadcast doesn't change anything viewing the "Only use 2G" checkbox in the android settings. Instead, using the
sqlite3 method in the
settings.db file there isn't a
global table and I can't find the preferred_network_mode option.
What I do wrong?
-
Martin
- Posts: 4468
- Joined: 09 Nov 2012 14:23
Post
by Martin » 10 Jan 2014 13:50
Hi,
Android provides no official API for this and no one has found a workaround or another unofficial method that really works on a stock ROM to my knowledge.
- am broadcast only works on modified ROMs (CyanogenMod or other ROMs that incorporated the same changes). The action Set Mobile Network Mode (2G/3G) uses this mechanism.
- You could also use action Set System Setting to change the global system setting (Android 4.2+) with Automagic (use at your own risk). Rebooting might be required. Temporarily turning airplane mode off/on or toggling the telephony radio did not work on my device.
Regards,
Martin
-
fede91it
- Posts: 19
- Joined: 10 Jan 2014 08:59
Post
by fede91it » 12 Jan 2014 09:29
Wooo, thanks for these sed information for me
My Android is 4.1.2 and no one of these methods works. I can try to switch to a cooked 4.2 rom.