Permissions in AndroidManifest.xml

We will first start off by giving Bluetooth permissions in the AndroidManifest.xml file. These permission includes:

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

Location permissions are necessary to run the scan, as the process requires to be run in the background and from Android Marshmallow onwards, any background process needs location permission otherwise, it will not yield the same result or no result.

Since we are developing the application for Bluetooth Low Energy, ...

Get Building Bluetooth Low Energy Systems now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.