How to force a GPRS connection instead of 3G or Wi-Fi?

I am writing an application where I need to have a special GPRS connection, even if Wi-Fi or 3G (or better) is available. I figured out how to disable Wi-Fi (using WifiManager ), however I can’t figure out how I can disable 3G programmatically and use only the GPRS connection, which is equivalent to manually changing this in the device’s settings.

Is there any way to do this with code?

UPDATE What I'm looking for does not have to be in the Android public APIs. It could also be in one of the undocumented APIs or, in extreme cases, device specific APIs, I just need something that works. However, I would prefer not to use the device to use these features.

+6
source share
3 answers

The problem is not only in private APIs, but in the fact that a third-party APK cannot get permission to change such a parameter.

As a result, this will require an embedded device in addition to reverse engineering private interfaces.

+2
source

As far as I know, changing the type of mobile network is not possible from the application.

0
source

In the android infrastructure, TelephonyManager is an object that provides telephony services for the Android application.
see http://developer.android.com/reference/android/telephony/TelephonyManager.html
The service provides several ways to know the status and information of your physical radio component.

But there is no way to change the way the physical radio station of your device works. Its a private logic for the manufacturer of your device, which tries to do its best to comply with the industry standard for radiophony and provide the best quality service to end users.

This is the public view of the android api (over dalvik), do not respond in the context of the private android avik, neither the native nor the privileged root path.

0
source

Source: https://habr.com/ru/post/895310/


All Articles