In other words you would like to put the datamode of the device from 3g mode into 2g mode. I would love that too, but I am afraid it is not possible to do that programatically. The apps I found on the playstore all just link to the settings but do not switch by themselves. I would love that functionality too, because in one of my apps I need slow but stable connection.
Switching on GPRS with Android 2.3.6 Build is working is fine (Toggle Library) but not with Android 4.1.1 , Is there any one help me to make it work on this .
Sub SetMobileData(Enabled As Boolean)
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.RunMethod2("getSystemService", "connectivity", "java.lang.String")
r.Target = r.GetField("mService")
r.RunMethod2("setMobileDataEnabled", Enabled, "java.lang.boolean")
End Sub
// Check we're on GPRS or EDGE
final int subType = network.getSubtype();
return subType == TelephonyManager.NETWORK_TYPE_EDGE
|| subType == TelephonyManager.NETWORK_TYPE_GPRS;
Since there is a function network.getSubtype() could it be that there is also a function network.setSubtype()?
Hi Erel It works fine with Android 4.0.4 but I am getting Permission Denial Error for WRITE_SECURE_SETTINGS , in Version 4.1.1 . , I have added permission also for write_Secure_settings too, Please suggest me a way.