我知道关于在机器人 已经 曾经 讨论过 很多 时间上程序化打开/关闭 GPS 的问题,答案总是一样的:
“出于安全/隐私方面的原因,你不能这样做,你必须转发到位置首选项屏幕,让用户启用/禁用它。”
我知道,但是我最近从市场上购买了 塔斯克,而且,在你可以用它完成的许多其他事情中,你可以设置规则,在进入预定义的应用程序时自动启用 GPS,并在退出时禁用它(请参阅 给你的教程如何做到这一点,它只是工作这个应用程序不能用固件签名键签名,因为它可以在许多安卓版本和不同的设备上工作,你甚至不需要被植入。
我想在我的应用程序中做到这一点。当然,我不想破坏用户的隐私,所以我首先会问用户是否想使用典型的“记住我的决定”复选框自动打开它,如果他回答是,就启用它。
有人知道塔斯克是怎么做到的吗?