Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android BLE example [closed]

I tried to look for complete examples that could help me with the development of the app but on the net I found only parts of code not linked to each other. Is it possible to see a complete example of connection including the communication part between the 2 devices? Also I happen to have a problem with the nRF Connect app: the bluetooth automatically disconnects from the device after about 30 seconds, why?

like image 717
Davide Torchia Avatar asked May 12 '26 10:05

Davide Torchia


1 Answers

BLE complete example link to github - contains Android, iOS, ESP32 - 2 apps for each platform, Central and Peripheral. Each Central is compatible with each Peripheral.

This is a great guide: The Ultimate Guide to Android Bluetooth Low Energy by PunchThrough.

About your second question (that automatic disconnection occurs), I remember I've noticed similar disconnections on iOS, but didn't find out the reason. I also noticed that after subscribing to a characteristic notifications/indications it's not disconnecting anymore, that's why I guess it could be operating system optimization for the inactive connections.

like image 182
alexander.cpp Avatar answered May 14 '26 03:05

alexander.cpp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!