问题描述
我正在开发一个需要激活 GPS 的安卓应用.
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:
不可能
但是……Cerberus"应用程序打开了我的 GPS……所以……这是可能的!
But... the "Cerberus" APP turns my GPS on... so... it's possible!
谁能帮我解决这个问题?
Can anyone help me with this?
推荐答案
不,不可能,也不合适.您不能在没有用户权限的情况下管理用户的电话.用户必须进行交互才能启用 GPS.
No, it's impossible, and inappropriate. You can't just manage the user's phone without their authority. The user must interact to enable GPS.
来自 Play 商店:
From Play Store:
当您尝试本地化设备时,如果 GPS 关闭,Cerberus 会自动启用 GPS(仅适用于 Android < 2.3.3),您可以保护它免遭未经授权的卸载 - 更多信息请参阅应用程序配置."
"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."
你可以这样做:
startActivity(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS));
这篇关于如何在 Android 上打开 GPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!