A Kotlin Coroutines-powered library for asynchronous Bluetooth Low Energy (BLE) communication across multiple platforms.
Kable is a Kotlin Multiplatform library that provides an asynchronous, Coroutines-based API for Bluetooth Low Energy (BLE) communication. It solves the problem of writing cross-platform BLE code by abstracting platform-specific details and offering a unified, modern API for scanning, connecting, and performing I/O operations with BLE devices.
Kotlin developers building cross-platform applications that need to communicate with BLE devices, such as IoT apps, health/fitness trackers, or smart device controllers on Android, iOS, web, and desktop.
Developers choose Kable for its seamless integration with Kotlin Coroutines, eliminating callback hell and simplifying async BLE operations. Its multiplatform support reduces code duplication, while its idiomatic Kotlin API makes BLE development more intuitive and maintainable compared to platform-specific SDKs.
Kotlin Asynchronous Bluetooth Low-Energy
Uses Kotlin Coroutines and Flows for all asynchronous operations like scanning and I/O, eliminating callback hell and making BLE code more readable and maintainable, as demonstrated in the SensorTag sample app.
Abstracts platform-specific BLE complexities, allowing developers to write shared code for Android, iOS, JavaScript, macOS, and JVM with a consistent API, reducing code duplication across targets.
Provides utilities like `Bluetooth.BaseUuid + 0x180D` and `Uuid.service('heart_rate')` for shorthand UUID notation, simplifying common BLE identifier management as outlined in the UUIDs section.
Handles connectivity with state flows, automatic service discovery, and support for reconnection, reducing boilerplate—examples include the `connect` and `disconnect` functions with automatic state transitions.
Some scanning filters, such as Address on Apple and JavaScript platforms, are not natively supported, forcing Kable to use less efficient flow filtering, which can impact scanning performance on those targets.
JavaScript support depends on Chrome's experimental Web Bluetooth API, requiring users to enable flags like 'Experimental Web Platform features,' making it unsuitable for production web apps needing broad browser compatibility.
Requires Gradle configuration with Kotlin Multiplatform and Coroutines dependencies, plus platform-specific permissions and CentralManager setup for background support, which adds overhead for developers new to this ecosystem.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.