0

I want to toggle GPS without going to android settings with Intents etc . for this i have already tried these methods which none of them worked :

How can I enable or disable the GPS programmatically on Android?

Toggle gps on root devices on Android

so as far as i understood , there is no way for doing this . What i am asking is , Is It possible to approach this editing custom rom or AOSP ? and if it is possible anyone can help OR any other ideas ?

Community
  • 1
  • 1
Aerox
  • 353
  • 3
  • 13

1 Answers1

0

You can do anything if you edit the AOSP. But I don't think you need to go that far. Use Settings.Secure.setLocationProviderEnabled(context.getContentResolver(), provider, true); and write a system app and you should be able to do it. A description of how to install your app as a system app can be found at http://www.addictivetips.com/mobile/how-to-install-any-app-as-system-app-on-android/. Then add the WRITE_SECURE_SETTINGS permission to your manifest and you're good.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127
  • thank you for your answer . i already tried to make System app with titanium backup but still i get the error permission now allowed – Aerox Aug 18 '14 at 07:17