John Connor John Connor - 18 days ago 6
Android Question

Does this work without the user's permission?

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: http://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?

Answer

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.