Examples
Example Android app for SimpleDroidBLE.
SimpleDroidBLE is deprecated
Use SimpleKtBLE instead. It has the same Kotlin API on Android, and the same code also runs on iOS, macOS, Windows, and Linux. New features land in SimpleKtBLE.
The SimpleBLE Explorer Android app lives in examples/simpleble-android.
It demonstrates:
- requesting Android Bluetooth permissions with the Activity Result API,
- explaining Android adapter selection,
- scanning and showing discovered peripherals,
- connecting and disconnecting cleanly,
- listing services and characteristics with capabilities,
- reading a selected characteristic,
- writing with request or command,
- subscribing to notify or indicate characteristics,
- showing errors in the UI,
- stopping scans on activity pause and cleaning up notification/connection work from the ViewModel.
Run it from Android Studio by opening examples/simpleble-android, or from the command line:
cd examples/simpleble-android
./gradlew :app:assembleDebugInstall the APK on an Android API 31+ device with BLE support.
