How to turn on the GPS on Android

后端 未结 7 610
[愿得一人]
[愿得一人] 2020-12-08 08:52

I am developing an android app which needs to activate the GPS.

I read a lot of topics in a lot of forums and the answer I\'ve found is:

it\'

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-08 08:54

    No it't impossible, and inappropriate. You can't just manage the users phone without his authority.

    From Play Store:

    "Cerberus automatically enables GPS if it is off when you try to localize your device (only on Android < 2.3.3) and you can protect it from unauthorized uninstalling - more info in the app configuration."

    You can do something like this:

    startActivity(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS));
    

提交回复
热议问题