問題描述
我有一個(gè) GPS 應(yīng)用程序已經(jīng)在清單中請(qǐng)求 ACCESS_FINE_LOCATION
權(quán)限,現(xiàn)在我想添加一個(gè)需要 ACCESS_COARSE_LOCATION
的庫(kù) (MoPub).
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
.
我是否正確假設(shè) ACCESS_FINE_LOCATION
就足夠了,我可以從清單中省略 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?
推薦答案
https://developer.android.com/guide/topics/location/strategies.html#Permission
注意:如果您同時(shí)使用 NETWORK_PROVIDER 和 GPS_PROVIDER,那么您只需要請(qǐng)求 ACCESS_FINE_LOCATION 權(quán)限,因?yàn)樗瑑蓚€(gè)提供商的權(quán)限.(ACCESS_COARSE_LOCATION 的權(quán)限僅包括 NETWORK_PROVIDER 的權(quán)限.)
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.)
簡(jiǎn)而言之:是的,如果您已經(jīng)定義了 ACCESS_FINE_LOCATION
,則不需要 ACCESS_COARSE_LOCATION
.
In short: yes, you don't need ACCESS_COARSE_LOCATION
if you've already defined ACCESS_FINE_LOCATION
.
這篇關(guān)于如果我已經(jīng)有 ACCESS_FINE_LOCATION,我可以省略 ACCESS_COARSE_LOCATION 嗎?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!