How to programmatically force bluetooth low energy service discovery on Android without using cache

I just had the same problem. If you see the source code of BluetoothGatt.java you can see that there is a method called refresh() /** * Clears the internal cache and forces a refresh of the services from the * remote device. * @hide */ public boolean refresh() { if (DBG) Log.d(TAG, “refresh() – device: … Read more

Location needs to be enabled for Bluetooth Low Energy Scanning on Android 6.0

No, this is not a bug. This issue was brought up to Google where they responded saying that this was the intended behavior and they won’t fix it. They directed developers to this site where it points out that location permission is now needed for hardware identifier access. It is now the developer’s responsibility to … Read more

Bluetooth Low Energy: listening for notifications/indications in linux

Try this… Run gatttool -b <MAC Address> –interactive like you did before. You’ll get a prompt and then you type connect. You should see a CON in the prompt indicating that you’ve connected to the device. Then type char-read-uuid 2902. You should get a list of all CCC (Client Characteristic Configuration) attributes on the device. … Read more

Android 4.3 Bluetooth Low Energy unstable

Important implementation hints (Perhaps some of those hints aren’t necessary anymore due to Android OS updates.) Some devices like Nexus 4 with Android 4.3 take 45+ seconds to connect using an existing gatt instance. Work around: Always close gatt instances on disconnect and create a fresh instance of gatt on each connect. Don’t forget to … Read more