4
votes
  1. can two different api calls each requiring a different permission produce the same results? e.g. to get device coarse location, from Android documentation, it is an approximate location derived from network location.. can an app retrieve network location using another api call that does not require ACCESS_COARSE_LOCATION permission?

In other words, according to Android documentation, regarding LocationManager, "A location provider provides periodic reports on the geographical location of the device....some providers require GPS hardware and visibility to a number of satellites; others require the use of the cellular radio, or access to a specific carrier's network, or to the internet" and all requires either ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permissions. if an app doesn't ask for these permissions yet it asks for ACCESS_NETWORK_STATE, ACCESS_WIFI_STATE, and INTERNET can the app infer location? if so, what API calls are responsible for this to happen, I read the API guide, connectivity part, and searched the classes under android.net.wifi but could not find what would create such situation.

  1. is there any work or a resource that groups Android api calls by required permissions?? e.g. a list of all api calls under ACCESS_COARSE_LOCATION permission, a list of all api calls under ACCESS_FINE_LOCATION permission and so on!

Hope I clearly asked my questions and thanks in advance!

1
Your question does not make sense to me. Could you clarify what you'd like to achieve? Regarding point 1, if you could retrieve the same information through another API call without the permission, why would there be a permission anyway?Leon Joosse
I added more details!Jana

1 Answers

1
votes
  1. According to the documentation:

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.)

You should take in consideration that coarse location (battery friendly) is not so precise as fine location (not battery friendly), AND usually they are required both because a user can decide to enable from device network location and disable GPS, it's your duty to optimize your app so it will not kill the battery. Information from above (and more about location) can be found here http://developer.android.com/guide/topics/location/strategies.html

  1. the previous link has some explanations about the location, with some examples.

And for future reference, you might find this table useful http://developer.android.com/guide/topics/manifest/uses-feature-element.html#features-reference