4

I noticed that with the new update to google map, if you have GPS is off, then it warns you about the accuracy. Here is the new thing, if you hit OK then it enables the GPS for you. Which means it is programmatically enabling GPS as opposed to me going to Settings. I have Kitkat running on samsung S4

Does this means that there is an official way to enable GPS programatically?IF yes then how?

Thanksenter image description here

Snake
  • 14,228
  • 27
  • 117
  • 250
  • I just tried on mine and it resulted in the same conventional way of doing it by intent. Can you please post a screenshot? – Kasra Jan 31 '15 at 20:57
  • There used to be security bug - I guess they fixed it. See this: http://stackoverflow.com/questions/4721449/how-can-i-enable-or-disable-the-gps-programmatically-on-android – Kasra Jan 31 '15 at 20:58
  • Here is the dialog that appears, if I click on ok then it will enable the GPS (without going to settings) – Snake Feb 01 '15 at 02:08
  • Yes, I can confirm after the new update you can turn on GPS/Location from within the Google Maps application. However haven't heard any news yet about how to use this in other apps. Probably an API in the next version of Google Play Services. – Sharjeel Feb 01 '15 at 02:27

1 Answers1

1

Google Play service 7.0 and above have this feature.

In Google Play services 7.0, we’re introducing a standard mechanism to check that the necessary location settings are enabled for a given LocationRequest to succeed. If there are possible improvements, you can display a one touch control for the user to change their settings without leaving your app.

http://android-developers.blogspot.in/2015/03/google-play-services-70-places-everyone.html

abbas.aniefa
  • 2,855
  • 21
  • 30