Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If I have ACCESS_FINE_LOCATION already, can I omit ACCESS_COARSE_LOCATION?

I have a GPS app that already requests ACCESS_FINE_LOCATION permission in the manifest, now I want to add a library (MoPub) that requires ACCESS_COARSE_LOCATION.

Am I correct in assuming that ACCESS_FINE_LOCATION is enough, and I can leave out ACCESS_COARSE_LOCATION from my manifest?

like image 872
charliefortune Avatar asked Mar 09 '13 12:03

charliefortune


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.

What is the use of Access_coarse_location?

If your app targets Android 12 or higher, the system logs the following error message in Logcat: ACCESS_FINE_LOCATION must be requested with ACCESS_COARSE_LOCATION. Note: To better respect user privacy, it's recommended that you only request ACCESS_COARSE_LOCATION .

What is fine location and coarse location?

Coarse location is for network provider's location and fine location is for both GPS provider and network location provider. So fine location covers both and you don't need to use anther one.


1 Answers

https://developer.android.com/guide/topics/location/strategies.html#Permission

Note: If you are using both NETWORK_PROVIDER and GPS_PROVIDER, then you need to request only the ACCESS_FINE_LOCATION permission, because it includes permission for both providers. (Permission for ACCESS_COARSE_LOCATION includes permission only for NETWORK_PROVIDER.)

In short: yes, you don't need ACCESS_COARSE_LOCATION if you've already defined ACCESS_FINE_LOCATION.

like image 163
Connor Tumbleson Avatar answered Sep 18 '22 11:09

Connor Tumbleson