How to force a GPRS connection instead of 3G or Wifi?
Asked Answered
B

3

6

I am writing an application where I need to have specifically a GPRS connection, even if wifi or 3G (or better) is available. I have figured out how to disable wifi (by using WifiManager), however, I can't seem to find out how I can programmatically disable 3G and only use a GPRS connection, with equal effect as changing this manually in the device settings.

Is there a way to do this with code?

UPDATE: What I am looking for does not necessarily have to be in the public Android APIs. It might as well be in one of the undocumented APIs, or as a last resort, device-specific APIs, I just need something that works. However, I'd rather not have to root a device to use these functions.

Broglie answered 18/8, 2011 at 9:29 Comment(0)
B
2

The issue is not just private APIs but that a 3rd party APK cannot get permission to modify such a setting.

As a result, doing so would require a rooted device in addition to reverse engineering private interfaces.

Bacterin answered 20/8, 2011 at 17:43 Comment(1)
does this hold true until today?Molnar
H
0

as far as i know changing the type of the mobile network is not possible out from an app.

Hoberthobey answered 18/8, 2011 at 9:31 Comment(2)
I know of at least one application which seems to have this capabiliy (namely the Extended Controls application), so I don't think it is impossibleBroglie
@Frxstream - have you verified that on a non-rooted device? "possible from an app" tends to refer to what Android is designed to allow apps to do, launching helper processes as the superuser not being a designed capability.Bacterin
M
0

In android framework, TelephonyManager is the object providing Telephony service to android application.
see http://developer.android.com/reference/android/telephony/TelephonyManager.html
The service do provide several methods to know state and information of your physical radio component.

But there is no way to modify the way the physical radio component of your device do its job. Its a private logic of your device manufacturer that try to do its best to comply radiophony industrial standard and provide the best end user experience quality

This is an public api android point of view (over dalvik) answer, do not answer in context of private android api, nor native way nor root privileged way.

Mccarty answered 18/8, 2011 at 9:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.