-1

I have Explored all the links available for turning on GPS location. Is It Deprecated now or Still we can make it working ?

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • You're not giving any useful information. On which platform ? – Perceval Feb 28 '15 at 13:05
  • @PercevalFARAMAZ..For Android OS – Nihar Shete Feb 28 '15 at 13:07
  • i've added the android tag for you, but you should probably explain a bit more in the questions. Or try here: http://android.stackexchange.com/questions/tagged/gps – Spacedman Feb 28 '15 at 13:08
  • @Spacedman -In simple word I want to switch on GPS on click of a button which is present in my activity. – Nihar Shete Feb 28 '15 at 13:12
  • You should link to whatever API documentation you have already found. Have you found something saying it is deprecated? Link to it. Or is it just that you cant find **anything**, and are thinking it might be deprecated? Edit your Q. – Spacedman Feb 28 '15 at 13:15
  • http://stackoverflow.com/questions/15426144/turning-on-and-off-gps-programmatically-in-android-4-0-and-above http://stackoverflow.com/questions/20048995/android-4-1-2-how-to-turn-off-gps-programmatically http://stackoverflow.com/questions/4721449/how-can-i-enable-or-disable-the-gps-programmatically-on-android http://stackoverflow.com/questions/20740365/programmatically-turn-on-gps-in-android I have referred all above links – Nihar Shete Feb 28 '15 at 13:18

1 Answers1

1

You are conflating enabled/disabled with on/off.

If the user has GPS disabled, you cannot enable it programmatically, except by directing the user to the appropriate page in the Settings app.

If the user has GPS enabled, you can turn GPS on by using a suitable location API (e.g., LocationManager). Android will turn GPS on and off as needed based on what apps are trying to get GPS fixes. But, again, this only works if the user has enabled GPS.

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