Keeping Up Continuous Development of BLE-Based Apps
summary
Demonstrates wrapping callback-heavy Android BLE (dozens of callbacks) into Kotlin Coroutines and Flow so code matches the device protocol steps: connect, await connected, discover services, await discovery, enable notifications (including writing the CCC descriptor), await notifications, and read/write characteristics. Presents a Bluetooth client implemented with MutableStateFlow and suspend/await helpers, discusses flaky issues like error 133 and silent Bluetooth stacks, and recommends toggling Bluetooth or restarting the device and capturing logs with Bugfender for debugging.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 2:28BLE communication basics
- 8:37Complex BLE scenarios
- 13:59Improving BLE with coroutines
- 18:36BLE issues and troubleshooting
- 21:28Debugging BLE in production
- 22:31BLE use cases and design
- 24:41Summary
related talks
44mGoing with the Flow - Using Coroutines 1.3.x
42mGo with the Flow
38mBluetooth LE for Modern Android Development
34mA journey in Android's BLE world
38mAndroid Coroutines: How to manage async tasks in Kotlin
36mBluetooth + Kotlin: It's a Match!
19mKotlin Flows and Channels for Android
43mAsynchronous programming using Coroutines
