Not compatible with Android 6
See original GitHub issueGetting error when trying to scan for Bluetooth devices. I assume this is due to not requesting permissions at runtime?
10-16 10:57:52.526 9400-9400/? D/BluetoothAdapter: startLeScan(): null 10-16 10:57:52.534 9400-9400/? D/BluetoothAdapter: STATE_ON 10-16 10:57:52.541 9400-9412/? D/BluetoothLeScanner: onClientRegistered() - status=0 clientIf=5 10-16 10:57:52.543 9400-9412/? W/Binder: Caught a RuntimeException from the binder stub implementation. 10-16 10:57:52.543 9400-9412/? W/Binder: java.lang.SecurityException: Need ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission to get scan results 10-16 10:57:52.543 9400-9412/? W/Binder: at android.os.Parcel.readException(Parcel.java:1599) 10-16 10:57:52.543 9400-9412/? W/Binder: at android.os.Parcel.readException(Parcel.java:1552) 10-16 10:57:52.543 9400-9412/? W/Binder: at android.bluetooth.IBluetoothGatt$Stub$Proxy.startScan(IBluetoothGatt.java:772) 10-16 10:57:52.543 9400-9412/? W/Binder: at android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper.onClientRegistered(BluetoothLeScanner.java:324) 10-16 10:57:52.543 9400-9412/? W/Binder: at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:56) 10-16 10:57:52.543 9400-9412/? W/Binder: at android.os.Binder.execTransact(Binder.java:453) 10-16 10:57:54.485 9400-9405/com.example.android.bluetoothlegatt I/art: Ignoring second debugger – accepting and dropping 10-16 10:57:54.545 9400-9480/? D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true 10-16 10:57:54.630 9400-9480/? I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 09/02/15, 76f806e, Ibddc658e36 10-16 10:57:54.638 9400-9480/? I/OpenGLRenderer: Initialized EGL, version 1.4`
Issue Analytics
- State:
- Created 8 years ago
- Comments:6
Top GitHub Comments
I have a fix in my fork https://github.com/anlif/android-BluetoothLeGatt. There’s also a pull request from someone else.
Was wondering why this example wasn’t working for me, thanks for your solution @anlif!