*Disclaimer*: Not 100% Kotlin related I was looki...
# android
l
Disclaimer: Not 100% Kotlin related I was looking at the
Bluetooth permissions
docs and there is stated:
Copy code
<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:
Copy code
<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:
Copy code
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"
    android:maxSdkVersion="30" />
This permission is still needed on API level 29 or lower.
😶 4
l
0% Kotlin? Then please don't ask it here @Lilly, and move it to a right place, as you can see in the topic of this channel.
l
Yes it's some weeks ago I have asked the question. Meanwhile I'm aware of the android only channel