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, ...