简体   繁体   English

Android - 一旦点击/关闭位置服务

[英]Android - Once click off/on location services

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: 我在Android中使用了一些使用位置服务的应用程序,但在大多数情况下,我希望在我需要它们之前保留这三个:

Use Wireless Networks Use GPS Satellites Location and Google Services 使用无线网络使用GPS卫星位置和Google服务

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 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 扎克

Is there a way to do that 有没有办法做到这一点

Not via the Android SDK on any modern version of the operating system. 在任何现代版本的操作系统上都不能通过Android SDK。

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. 否。这些位置提供程序已禁用,因此在保持禁用状态时无法使用。

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. 是和否,可能你得到缓存的位置。

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. 它可以通过以root身份运行的帮助程序访问它,因此您需要一个root电话。 Alas it can't find busybox on my 4.2.2 system so I've not been able to test it yet. 唉它在4.2.2系统上找不到busybox,所以我还没能测试它。

Quite disappointing, though perhaps unsurprising, that this option isn't convenient by default. 非常令人失望,尽管可能并不令人惊讶,默认情况下这个选项并不方便。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM