我什么时候应该使用ACCESS_COARSE_LOCATION权限? [英] When should I use ACCESS_COARSE_LOCATION permission?

查看:1834
本文介绍了我什么时候应该使用ACCESS_COARSE_LOCATION权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个Android应用程序,该应用程序将跟踪用户的地理位置并在地图上绘制其路线.

I am building an Android app that will track the user's geolocation and draw their route on a map.

我正在使用Google Play服务位置API,如此处所述.

I am using the Google Play Services location API, as described here.

很直观,我的应用程序需要ACCESS_FINE_LOCATION权限,该权限已放入清单中:

It is intuitive that my application requires the ACCESS_FINE_LOCATION permission, which I put in the manifest:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

我还需要ACCESS_COARSE_LOCATION权限吗? 我需要粗略位置的用例是什么?

Do I also need the ACCESS_COARSE_LOCATION permission? What's the use case where I need the coarse location?

推荐答案

我还需要ACCESS_COARSE_LOCATION权限吗?

Do I also need the ACCESS_COARSE_LOCATION permission?

否.

我需要粗略位置的用例是什么?

What's the use case where I need the coarse location?

如果您不要求输入ACCESS_FINE_LOCATION,但是您需要位置数据,并且愿意将该数据变得模糊(例如,距用户位置不远的一个城市街区).对于LocationManager,只能使用NETWORK_PROVIDER;否则,不能使用NETWORK_PROVIDER.如果是Play Services融合的位置提供程序,则应在内部进行处理.

If you do not ask for ACCESS_FINE_LOCATION, but you need location data, and you are willing for that data to be fuzzy (say, up to around a city block from the user's position). In the case of LocationManager, you can only use the NETWORK_PROVIDER; in the case of the Play Services fused location provider, they should handle this internally.

很久以前,很久以前,在安装时就告诉用户该应用程序是要粗略的位置访问还是精细的位置访问.用户可能会接受需要粗略访问的应用程序,但会拒绝想要精细访问的应用程序.

Once upon a time, long long ago, users were told at install time whether the app wanted coarse or fine location access. Users might accept apps that wanted coarse access but reject apps that wanted fine access.

由于用户界面已更改,并且用户在确定应用程序需要粗略或精细位置权限时会遇到很多困难,我怀疑大多数开发人员仅要求精细位置许可.话虽这么说,如果您知道您的应用程序不需要这种准确性(例如,您想要天气预报的位置),那么在隐私权和隐私方面,要求粗略的位置许可是一个不错的提示".可能会再次证明是有益的.

Since the UI for this has changed, and users would have a fair bit of difficulty determining whether an app wants coarse or fine location permission, I suspect that most developers just ask for fine location permission. That being said, if you know that your app does not need that level of accuracy (e.g., you want the location for a weather forecast), asking for coarse location permission is a nice "tip of the hat" in the direction of privacy and may prove beneficial once again in the future.

这篇关于我什么时候应该使用ACCESS_COARSE_LOCATION权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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