Android 位置权限 [英] Android location permissions

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

问题描述

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

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

  1. 我应该在 android 中包含哪些主要的权限manifest 文件,以便使用 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天全站免登陆