0

I am developing an android app and I need to turn on gps automatically if gps is off and if users try to turn off gps then too I need to turn gps on. In short users must not be able to turn of gps. But I have read that this is possible only in rooted phones. But this app need to be used in unrooted phones. Is there anyway to turn gps on automatically? and never allow to turn off?

eccentricCoder
  • 846
  • 1
  • 14
  • 35
  • 1
    http://stackoverflow.com/a/5305835 – Sree Apr 02 '14 at 11:28
  • 1
    This is not possible now. Because Android Developer has close the security loop-hole. Check my [answer](http://stackoverflow.com/a/22529296/3330969) – Lucifer Apr 02 '14 at 11:31
  • I have tried that out but it is working in Micromax devices only The OS version i tested is 4.2.2 and 4.2.1. It does seem to work for either Samsung devices or LG devices for same OS versions – eccentricCoder Apr 03 '14 at 09:12

1 Answers1

3

Fortunately, no, for obvious privacy reasons. You will find various script-kiddie hacks that may work on certain devices or certain older Android versions, but that is it.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491