As per my requirement . I want to enable and disable GPRS Programmatically.I Googled for a day , did not able to find any suitable solution for it. Is it possible to Enable and Disable GPRS through our code...if yes the give me some valuable link or ideas to do this.As apndroid Application use the same thing to achieve the requirement.
Asked
Active
Viewed 6,369 times
0
-
Take a look at this so [question](http://stackoverflow.com/questions/3644144/how-to-disable-mobile-data-on-android) – Vladimir Apr 24 '12 at 13:04
-
Yes..but This does not work on 2.3 or any higher version of android OS – Apr 24 '12 at 13:29
-
Did you look at second answer (that is not accepted)? – Vladimir Apr 24 '12 at 13:37
-
[this answer](http://stackoverflow.com/questions/3644144/how-to-disable-mobile-data-on-android/8962211#8962211) – Vladimir Apr 24 '12 at 13:45
-
Which solution worked for you? – Usman Rana Aug 14 '17 at 05:56
2 Answers
1
Maybe this could help you:
How to disable Mobile Data on Android
Furthermore u can check the current connectionType (GPRS, 2G, LTE etc) with
TelephonyManager telMgr = (TelephonyManager) _context.getSystemService(Context.TELEPHONY_SERVICE);
telMgr.getNetworkType()
The TypeConstants are defined in the TelephonyManager Class
http://developer.android.com/reference/android/telephony/TelephonyManager.html
GL
-
Hi Thomas K. I have already looked in to the API but there is no such method to Enable or disable GPRS/Internet Connection. – Apr 24 '12 at 13:34
-
The solution of the link I posted contains a working code that uses reflection. Afaik this is a good workaround for enabling/disabling connections. Did u try it? – Thkru Apr 24 '12 at 13:48
0
The code written in this OpenSource project might be usefule to you to switch GPRS.
I haven't tried so far..so can't write more.

MKJParekh
- 34,073
- 11
- 87
- 98