Lilly
08/28/2021, 10:02 PMBluetooth permissions
docs and there is stated:
<manifest ... >
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<!-- If your app targets Android 9 or lower, you can declare
ACCESS_COARSE_LOCATION instead. -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
...
</manifest>
I'm wondering:
When I follow this advice I end up declaring both permission FINE and COARSE, while I can restrict the use of COARSE:
<uses-permission-sdk-23 android:name="android.permission.ACCESS_COARSE_LOCATION"
android:maxSdkVersion="28" />
But can I configure FINE_LOCATION so that it's only declared when API is >28? I mean isn't it a problem when I have both permission declared although I only need one of them at the same time?
Same goes for the new permission BLUETOOTH_CONNECT/SCAN that is only needed on API level 31.
I'm also wondering why FINE_LOCATION is stucked out on the New Bluetooth permissions in Android 12 page. Isn't it better to declare FINE_LOCATION like the other legacy
permissions:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"
android:maxSdkVersion="30" />
This permission is still needed on API level 29 or lower.louiscad
08/29/2021, 6:52 AMLilly
09/13/2021, 11:01 AM