Because I can't post a comment, I am asking a question instead. I am not a java programmer, but I am wondering if it is possible to turn on the GPS without the user's permission. I found this answer: https://stackoverflow.com/a/33555732. I don't know java, but from what I can see from the comments is that it tries to turn on the GPS and if that doesn't work, it will prompt the user a dialog? Is that correct? Is that code really able to turn on the GPS without the user's permission?
Asked
Active
Viewed 64 times
2 Answers
1
but I am wondering if it is possible to turn on the GPS without the user's permission
No.
but from what I can see from the comments is that it tries to turn on the GPS and if that doesn't work, it will prompt the user a dialog?
Correct.
Is that code really able to turn on the GPS without the user's permission?
No, because the user is giving permission through the dialog. Play Services is enabling GPS based upon the response to the dialog.

CommonsWare
- 986,068
- 189
- 2,389
- 2,491
1
You cannot access location without user's permission, because to turn on the GPS you can access user's location. Today you can ask to permission dynamically using Requesting Permission at Run Time, take a look: https://developer.android.com/training/permissions/requesting.html

isabelaterribili
- 21
- 2