BluetoothKit is an incredibly lightweight and simple open source library to interface with Bluetooth devices on Android.
Setup
Add this to your build.gradle
gradle allprojects { repositories { ... maven { url 'https://jitpack.io' } } }
then add the dependency gradle dependencies { implementation 'com.github.sirvar:bluetoothkit-android:Tag' }
Usage
Initialize
kotlin val bluetoothKit: BluetoothKit = BluetoothKit()
Enable Bluetooth
kotlin bluetoothKit.enable()
Get Device
kotlin val device = bluetoothKit.getDeviceByName("Rikin's AirPods")
Connect Device
kotlin bluetoothKit.connect(device)
That's it
Check out the complete docs in the wiki
Made with ❤ by Rikin Katyal
from The Android Arsenal
No comments:
Post a Comment