我希望我的應用程序訪問GPS /網絡位置,如果它們是可用的。 我不希望Google Play過濾掉沒有GPS /網絡定位器的設備。位置:GPS /網絡權限:想要如果可用
我該怎麼做?
目前我有這對我的清單:
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-feature android:name="android.hardware.location" android:required="false" />
不過,我不知道它是足夠的,因爲http://developer.android.com/guide/topics/manifest/uses-feature-element.html#permissions-features指出:
-permission ACCESS_COARSE_LOCATION意味着android.hardware.location.network
和 android.hardware.location
功能要求
- 許可* ACCESS_FINE_LOCATION暗示android.hardware.location.gps
和 android.hardware.location
難道我還必須添加 <uses-feature android:name="android.hardware.location.network" android:required="false" />
和 <uses-feature android:name="android.hardware.location.gps" android:required="false" />
?
爲什麼?
不應該<uses-feature android:name="android.hardware.location" android:required="false" />
夠了嗎?
它明確地說和強調「和」,所以我認爲你需要把所有的使用功能。 – 2012-07-12 17:34:21