Android - Once click off/on location services

血红的双手。 提交于 2019-12-25 01:41:14

问题


I use a few apps that use the location services within Android, but for the most part I would like to keep these three off until I need them:

Use Wireless Networks Use GPS Satellites Location and Google Services

I would like to design an app that can one click toggle these three. So I have have two questions.

  1. Is there a way to do that, or is the only way to toggle them is by using:

android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS

And then doing it manually? And....

  1. If a few apps are using access course location and access fine location, does it even matter that I have these toggled off? Can they still get my location?

Thanks for the input.

Zach


回答1:


Is there a way to do that

Not via the Android SDK on any modern version of the operating system.

If a few apps are using access course location and access fine location, does it even matter that I have these toggled off? Can they still get my location?

No. Those location providers are disabled, and therefore are not available for use while they remain disabled.




回答2:


No. it is not possible now, because those settings are in Secure setting. Only user can change that, not application.

Yes & No, probably you get cached location.




回答3:


Went looking for just this thing and for that reason. And I found one! Appropriately enough, it's called Secure Settings.

It's able to access it via a helper program that runs as root so you'll need a rooted phone. Alas it can't find busybox on my 4.2.2 system so I've not been able to test it yet.

Quite disappointing, though perhaps unsurprising, that this option isn't convenient by default.



来源:https://stackoverflow.com/questions/11546214/android-once-click-off-on-location-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!