Skip to content

Instantly share code, notes, and snippets.

@jeffhuangtw
Created February 11, 2022 01:22
Show Gist options
  • Save jeffhuangtw/2f1e91ba6da745d8f975ab85ecbcbcb2 to your computer and use it in GitHub Desktop.
Save jeffhuangtw/2f1e91ba6da745d8f975ab85ecbcbcb2 to your computer and use it in GitHub Desktop.
android 12 ble
<manifest>
<!-- Request legacy Bluetooth permissions on older devices. -->
<uses-permission android:name="android.permission.BLUETOOTH"
android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"
android:maxSdkVersion="30" />
<!-- Needed only if your app looks for Bluetooth devices.
You must add an attribute to this permission, or declare the
ACCESS_FINE_LOCATION permission, depending on the results when you
check location usage in your app. -->
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"
android:usesPermissionFlags="neverForLocation" />
<!--
Location permission has been removed from here, as it may not be required for
Android 12 onwards. It is required on Android 6-11 when scanning for Bluetooth LE devices.
-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"
android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"
android:maxSdkVersion="30" />
</manifest>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment