bluetooth
| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |
|---|---|---|---|---|
| November 29, 2023 | - | - | - | 1.0.0-alpha02 |
Declaring dependencies
To add a dependency on Bluetooth, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.
Add the dependencies for the artifacts you need in the build.gradle file for
your app or module:
Groovy
dependencies { implementation "androidx.bluetooth:bluetooth:1.0.0-alpha02" }
Kotlin
dependencies { implementation("androidx.bluetooth:bluetooth:1.0.0-alpha02") }
For more information about dependencies, see Add build dependencies.
Feedback
Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.
See the Issue Tracker documentation for more information.
There are no release notes for this artifact.
Version 1.0
Version 1.0.0-alpha02
November 29, 2023
androidx.bluetooth:bluetooth:1.0.0-alpha02 and androidx.bluetooth:bluetooth-testing:1.0.0-alpha02 are released. Version 1.0.0-alpha02 contains these commits.
New Features
- Lower
minSdkVersionto 21
API Changes
GattServerConnectFlow#updateServicesbecomes a suspend function (I0237d)- Change
AdvertiseParams.durationMillisto Long (If6771) - Convert
openGattServerto Flow (Icef54) - Throw
ScanExceptionon scan fail and set scanner tosetLegacy(false)by default (Ib337c) - Throw
AdvertiseExceptionon advertise fail (I0e691) - Add general bluetooth exception to catch (I0130d)
- Convert advertise to Flow and change maximum duration (I32fd8)
- Add
serviceDataandserviceSolicitationUuidstoScanResult(I6d7f0) - Change
durationMillisfrom Long to Duration (I89d49) - Add rssi, and
periodicAdvertisingIntervaltoScanResult(I60b51) - Add
serviceSolicitationUuidandsolicitationUuidMasktoScanFilter(Ic2206) - Added
GattServerSessionScope#subscribedCharacteristics(I0edab) - Add
serviceSolicitationUuidstoAdvertiseParams(Ic9aa7) - Change
AdvertiseParams.durationMillisfrom Int to Long (I6873f) GattServerSessionScope#notifydoes not return but throws an exception if it fails (Ifc26f)
Bug Fixes
- Extract scan functionality (I4d43f)
Version 1.0.0-alpha01
September 20, 2023
androidx.bluetooth:bluetooth:1.0.0-alpha01 and androidx.bluetooth:bluetooth-testing:1.0.0-alpha01 are released. Version 1.0.0-alpha01 contains these commits.
New Features
- This is the initial release of AndroidX Bluetooth APIs that provides a Kotlin API surface covering Bluetooth LE scanning and advertising, and GATT client and server use cases. It provides a minimal API surface, clear thread model with async and sync operations, and ensures all methods be executed and provides the results.