如何在 Android 上打开 GPS [英] How to turn on the GPS on Android

查看:41
本文介绍了如何在 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆