Hey,
hope this is the right place to ask this.
Is it possible to programmatically disable/enable the Mobile Data / Cellular Data? So to be more precise: can an app switch this on off automatically?
Thanks, Matt
In non-rooted Android devices, this is currently not possible and I am pretty sure it is not possible on IOS either. For Android, you can find more info in this post.
The short answer is no as for android, it cannot be turned on/off automatically. User action is required.
The best you can do is to guide a user to the settings screen, where they can enable/disable it manually.
the setMobileDataEnabled()
method is no longer callable via reflection. It was callable since Android 2.1 (API 7) to Android 4.4 (API 19) via reflection, but as of Android 5.0 and later, even with the rooted phones, the setMobileDataEnabled()
method is not callable. You need to have MODIFY_PHONE_STATE permission which is only given to system or signature apps.
There are various solution provided for rooted device, which you can have a look here.