I am making an Android app for a school project, I just need to be able to communicate with a device using BLE.
I am at the point where I am connected to the GATT server of my device, but i can't find any services as onServicesDiscovered
callback is never called.
I have followed the instructions of android - BLE gatt.discoverServices() returns true but Callback never fires - Stack Overflow and android - onServicesDiscovered never called while connecting to GATT Server - Stack Overflow but it doesn't makes it work...
I also replied to one of these posts, here is my message :
I am currently getting the same issue, without beeing able to correct it with a delay. I even called
gatt.discoverServices()
using a button to ensure the connection to be done before searching for services but doesn't work either.
When I press this button, I get thisgatt.discoverServices()
log.
Have you got any idea on how to deal with it ?
Edit: the following two permissions are in my manifest but I can't manage to let the user enable them, they seem to be not granted at start. BUT, all the methods that seemed to need these permissions at this point are working fine (bluetoothAdapter.startDiscovery()
ordevice.getName()
for instance).
Manifest.permissions.BLUETOOTH_CONNECT
Manifest.permissions.BLUETOOTH_SCAN
Any idea on how to deal with it ?