Android Question Read Notify

tonga

Member
Licensed User
Longtime User
Hi all,

I'm new to Bluetooth low energy. I have a module BLE that notify some data that are changing, but I'm not able to extract the values from the respective characteristics.

Someone can help me?

Thanks in advance
 

emexes

Expert
Licensed User
We've just been on a similar adventure, and the following path might be your quickest to the finishing line...

Per the three posts starting at: https://www.b4x.com/android/forum/threads/bluetooth-4-0-data-exchange.103107/#post-646660
- Check that your Android device supports BLE first using BLE Checker
- Connect to and read data from your module using nRF Connect. Ideally make sure the data changes, ie, that you're not just reading some static sample value.
- Note the address of your device, and the service and characteristic UUIDs of the data you need to read.
- Disconnect from the device (otherwise it will likely not be emitting advertisements, making it harder to connect to later)

Per the three posts starting at: https://www.b4x.com/android/forum/threads/bluetooth-4-0-data-exchange.103107/page-2#post-646916
- Create a new project from scratch
- Copy in the Starter module code
- Add permissions guff etc
- Change the device id, service uuid and characteristic uuid lines to match your module

*** Optional (if you need to use notifications or indications to read data) ***
Per the two posts starting at: https://www.b4x.com/android/forum/threads/bluetooth-4-0-data-exchange.103107/page-3#post-647090
- Use indications or notifications to have your module push data to you, rather than the Android device having to poll your module

Voila! (hopefully ;-)

Let us know how you fare.
 
Last edited:
Upvote 0

tonga

Member
Licensed User
Longtime User
Hi emexes,

thank you for your quick reply! As soon as possible I will get to work and I will tell you the results.
 
Upvote 0

emexes

Expert
Licensed User
No worries. You're not alone with this, it's like every couple of days there's somebody heading off on a BLE safari on this forum. Erel's BLE2 example is great, but I get the feeling it's also a bit comprehensive and maybe intimidating for people who are also coming to grips with B4A at the same time. So I've tried to simplify things, and the only assumption I think remains is that you know to save the new project into a blank directory and let B4A create its own directory structure under that.

If there is anything about those instructions that makes things harder rather than easier, let me know (I promise not to take it personally ;-) and if I ever get around to tidying up the mess, I'll factor all suggestions in then.

Now... don't let me distract you here, get back into that jungle :)
 
Last edited:
Upvote 0
Top