0

I am making an android app that provide a location for user for emergency situations . Now I want the app to enable the mobile data when the user open the app .. thanks in advance

0

1 Answer 1

0

Unless you have a rooted phone I don't think you can enable and disable data programmatically because in order to do so we have to include MODIFY_PHONE_STATE permission which is only given to system or signature apps.

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.