1

I know there are two different types of location permissions

  • ACCESS_COURSE_LOCATION
  • ACCESS_FINE_LOCATION

I know that for using the location from Android M, we require runtime permission form the User. Now the issue is that both ACCESS_COURSE_LOCATION and ACCESS_FINE_LOCATION falls under the same bucket and which implies that granting one runtime permission will grant the other one without asking the user.

So, now my doubt is that if I just ask ACCESS_COURSE_LOCATION permission and still can have the ACCESS_FINE_LOCATION then why should I need to request ACCESS_FINE_LOCATION? Can I just get a fine location with just ACCESS_COURSE_LOCATION location permission?

Also, I am requesting a location fix with the below criteria

Criteria criteria = new Criteria();
criteria.setBearingAccuracy(Criteria.ACCURACY_MEDIUM);
criteria.setPowerRequirement(Criteria.POWER_MEDIUM);
riteria.setCostAllowed(false);

So how do the two different permissions affect the location fix I am getting with the above criteria?.

EDIT 1: Rephrasing the question. I know about the different providers like GPS, network, etc. and which permission they require. That's why my doubt is that if granting ACCESS_COURSE_LOCATION can result in granting ACCESS_FINE_LOCATION. Then can we have a situation during app lifecycle where we have only ACCESS_COURSE_LOCATION granted? Also, how would the above criteria behave?

EDIT 2: Few other StackOverflow answers says that ACCESS_COURSE_LOCATION can be eliminated when ACCESS_FINE_LOCATION is granted. But if I just want a course location, I request permission and then I request location fix using the above criteria. So what should I expect a course location or a fine location? as granting course location is internally granting the fine location permission as well.

Raj Suvariya
  • 1,592
  • 3
  • 14
  • 36
  • you don't need `ACCESS_COARSE_LOCATION` if you' already defined `ACCESS_FINE_LOCATION` . Accuracy can vary between Only Network Provider and GPS Provider.. [Read This](https://stackoverflow.com/questions/6775257/android-location-providers-gps-or-network-provider) and [This](https://stackoverflow.com/questions/15310742/if-i-have-access-fine-location-already-can-i-omit-access-coarse-location). – ADM May 03 '19 at 10:36
  • @ADM I already know about the providers and which permissions they require. That's why my doubt is that how can I have a situation where I can only grant `ACCESS_COARSE_LOCATION `? – Raj Suvariya May 03 '19 at 10:39
  • [When should I use ACCESS_COARSE_LOCATION permission?](https://stackoverflow.com/questions/35869610/when-should-i-use-access-coarse-location-permission) – ADM May 03 '19 at 10:47
  • @ADM Again this answer just says that `ACCESS_COARSE_LOCATION` can be eliminated when you have `ACCESS_FINE_LOCATION` permission. But let's say I don't want fine location I just want course location so I request course location and then a location fix with the criteria mentioned in the question. So now the situation would be that I have fine permission as well so it is giving me a fine accurate location, not course location. – Raj Suvariya May 03 '19 at 11:02

0 Answers0