Android位置权限 [英] Android location permissions

查看:530
本文介绍了Android位置权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 Android 应用程序中,我愿意使用 GPS位置.

In my Android application I'm willing to use GPS locations.

  1. 我应该在 android中包括哪些主要的权限? 清单文件以使用GPS位置.
  2. 如果丢失了GPS信号,则可以使用移动网络三角测量该位置.
  1. What are the main permissions that I should included in android manifest file in order to use GPS locations.
  2. In case of lost the GPS signal strength, is there any way to triangulate the position using mobile networks.

谢谢!

推荐答案

您需要的主要权限是android.permission.ACCESS_COARSE_LOCATIONandroid.permission.ACCESS_FINE_LOCATION.

The main permissions you need are android.permission.ACCESS_COARSE_LOCATION or android.permission.ACCESS_FINE_LOCATION.

只有精确的位置才能访问gps数据,并且可以访问粗略位置提供的所有其他信息.您可以使用 LocationManager 的方法从gps获取位置数据并细胞塔资源已经存在,您不必自己计算出这些信息.

Only fine location will allow you access to gps data, and allows you access to everything else coarse location gives. You can use the methods of the LocationManager to acquire location data from gps and cell tower sources already, you do not have to work out this information yourself.

如果您定位到API级别21(5.0)或更高级别,则可能还需要以下条件:

If you are targeting API Level 21 (5.0) or higher, you may also need this:

<uses-feature android:name="android.hardware.location.gps" />

这篇关于Android位置权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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