Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When should I use ACCESS_COARSE_LOCATION permission?

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

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

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"/> 

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

like image 504
Terry Avatar asked Mar 08 '16 14:03

Terry


People also ask

What is the difference between ACCESS_COARSE_LOCATION and Access_fine_location?

Another thing you should keep in mind that ACCESS_FINE_LOCATION gives you better and accurate location and ACCESS_COARSE_LOCATION gives you less accurate location.

Why does your app need access to location in the background?

Background location may only be used to provide features beneficial to the user and relevant to the core functionality of the app. Apps designed specifically for children must comply with the Designed for Families policy.

What is read phone state permission?

Reading phone state (READ_PHONE_STATE) lets the app know your phone number, current cellular network information, the status of any ongoing calls and so on. Make calls (CALL_PHONE). Read the list of calls (READ_CALL_LOG).


1 Answers

Do I also need the ACCESS_COARSE_LOCATION permission?

No.

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

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.

UPDATE 2021-11-16: Android 12 changes the UI if you ask for ACCESS_FINE_LOCATION. The user now has the option of downgrading you to only getting ACCESS_COARSE_LOCATION access, by choosing "Approximate" instead of "Precise".

like image 129
CommonsWare Avatar answered Sep 21 '22 00:09

CommonsWare