Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
434 views
in Technique[技术] by (71.8m points)

android - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...