LinkMobile
An Android SDK for discovering and interacting with Last Lock devices over Bluetooth.
Contents
Overview
LinkMobile connects your app to Last Lock hardware with a simple, high-level API. It handles Bluetooth Low Energy (BLE) discovery, connection, and proxy-backed communication so you can focus on your product experience instead of writing a BLE stack.
The SDK also supports a background proxy connection that lets devices communicate with Last Lock's cloud services when required.
Packages
Usage
Initialize and start scanning
Bridge.init(context = applicationContext, serverAddress = "<your-backend-host>")
Bridge.setLogsEnabled(isEnabled = true)
// Start scanning for peripherals advertising the default FC5A service UUID.
Bridge.start()
// To scan for a different service UUID, pass it explicitly.
// Bridge.start(UUID = "<ble-service-uuid>")
val blueLink = Bridge.getBlueLink()
blueLink.addListener(listener = myBlueLinkListener, prependListener = false)
Content copied to clipboard
To receive discovery and connection events, implement `BlueLinkEventListener` (for example: `BlueLinkEventListener/onDeviceDiscovered(device:advertisementData:rssi:signalStrength:connectionStatus:)` and `BlueLinkEventListener/onDeviceConnected(device:)`).