I am working on an app that is connected to the BLE device using BluetoothGatt
.
I am successfully able to scan and connect with BLE devices in all devices like Samsung, Pixel, etc. I followed Android official BLE connection guide for scanning and connection.
But after updating my Pixel 2
to Android 10
, I am not able to connect my BLE device to Pixel 2. I also, seen the same issue was reported in Google issue tracker.
To fix this I tried clear Bluetooth app cache and Network reset but It works in some devices but not all.
Is there anything that needs to be done to fix this issue or is there a proper way to clear Bluetooth app cache and Network reset programmatically.
Or any other way to manage BLE connection in Android?
On Android 10 (API 29), permissions changed and now require ACCESS_FINE_LOCATION for BLE scanning if it is your compilation target.
However, if you've compiled against API 28, and have ACCESS_COARSE_LOCATION, it should continue to work on Android 10.
Src: https://developer.android.com/about/versions/10/privacy/changes#location-telephony-bluetooth-wifi
See the following as this question may be a potential duplicate: Android 10 not working with BLE Bluetooth scanning
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With