When should I use ACCESS_COARSE_LOCATION permission?

Viewed 79020

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?

5 Answers

ACCESS_FINE_LOCATION includes ACCESS_COARSE_LOCATION. However, there is a catch:

ACCESS_COARSE_LOCATION gives you last-known location which is battery friendly https://developer.android.com/training/location/retrieve-current.html#setup This has a dependency on Google Play Services

However, if you need something like live/ real-time location, use ACCESS_FINE_LOCATION It gives you live/ real-time location. You'll need to use a LocationListener though.

In simple word ACCESS_FINE_LOCATION gives you better and accurate location and ACCESS_COARSE_LOCATION gives you less accurate location.

Related