Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

android

gprs

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.

like image 609
Frxstrem Avatar asked Aug 18 '11 09:08

Frxstrem


1 Answers

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.

like image 158
Chris Stratton Avatar answered Oct 20 '22 17:10

Chris Stratton