Search code examples
androidbluetoothpermissionslocationandroid-manifest

Android requires user to enable permissions for my app that are already requested in manifest


The application I am developing uses Bluetooth and Storage permissions, therefore my AndroidManifest.xml contains the following.

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"></uses-permission>
<uses-permission android:name="android.permission.BLUETOOTH"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE"></uses-permission>

However, when the app is installed, upon scanning for Bluetooth devices nothing is found until I manually switch on permission for Location in my device settings (Settings -> Apps -> [My App] -> Permissions). I have read somewhere that this permission is required for Android 6.0 (maybe 7.0) and above if you want to use the Bluetooth, but why is it not enabled upon installation with these permissions in the manifest file? Have I missed one out?


Solution

  • Location and Bluetooth are two different things.

    You don't need to request permission to access Bluetooth as it is a normal permission, but you do need to request permission for Location as it is a dangerous permission.

    You can find a list of all permissions that must be requested on runtime here.