Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 772 Bytes

api23-bluetooth.md

File metadata and controls

9 lines (6 loc) · 772 Bytes

Bluetooth discovery on Android API level 23

Since marshmallow update Bluetooth discovery using BluetoothAdapter.getDefaultAdapter().startDiscovery(); is broken.

This is because Bluetooth Adapter has been change in Android 6.0; You need to set the permission ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permission and need to use BluetoothLeScanner.startScan() method to start the scan.
Same requirement if you're using BluetoothAdapter.getDefaultAdapter().startDiscovery();

Source on SO
Explanation on Android developer docs