Can anyone tell me how to switch on GPS without asking any pop up dialog's or alerts. Is there a way to do so in android studio.
Asked
Active
Viewed 82 times
-2
-
2Possible duplicate of [Start Gps without any popup dialogue](https://stackoverflow.com/questions/30788262/start-gps-without-any-popup-dialogue) – Jyoti JK May 22 '18 at 10:27
-
2These pop-ups are there for user security. Turning them off is a BAD idea. – Philip Couling May 22 '18 at 10:27
-
1@Ankith Prakash even google map asks you to turn on GPS.So for security reasons its not possible now. – Bhagyashri May 22 '18 at 10:28
-
if once we give permission, can we access location pro grammatically afterwords even if the GPS is Off?? – Ankith Prakash May 22 '18 at 11:11
2 Answers
2
Can anyone tell me how to switch on GPS without asking any pop up dialog's or alerts
AFAIK this is not Possible due to security reason
Is there a way to do so in android studio.
Not Possible

AskNilesh
- 67,701
- 16
- 123
- 163
0
It is not possible. There is no way to enable the GPS programmatically. You have to show the permission dialog to the user. It depends on user whether they want to enable GPS or not.

Sabyasachi
- 3,499
- 2
- 14
- 21