How to turn on the GPS on Android(如何在 Android 上打开 GPS)
问题描述
我正在开发一个需要激活 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 Android 上打开 GPS
基础教程推荐
- NSString intValue 不能用于检索电话号码 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
