Skip to content

Adding the SDK ​

The SDK is distributed as a binary .aar from a Maven repository served over GitHub Pages. Add the repository and the coordinate:

kotlin
// settings.gradle.kts
dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://getsensr-io.github.io/mobile_sensorbio_sdk_android_binary/") }
    }
}

// app/build.gradle.kts
dependencies {
    implementation("com.sensorbio:sensorbio-sdk:4.2.1")
}

The single coordinate brings everything: the SDK plus the embedded BLE + edge-algorithm binaries (including native .so for arm64-v8a, armeabi-v7a, x86, x86_64) are bundled inside the one .aar. gRPC, protobuf-javalite and Guava are bundled too, relocated under com.sensorbio.sdk.shaded.*, so they never collide with your app's own copies (e.g. Firebase Firestore's protobuf) and you can use any version of them you like. The remaining open-source dependencies (OkHttp, Gson, joda-time, Paho MQTT, DiskLruCache, Room, AndroidX lifecycle/WorkManager, coroutines, …) are declared in the POM and resolved automatically from google() / mavenCentral(). The bundled libraries and their versions are listed in the binary repo's README and inside the .aar at META-INF/com.sensorbio.sdk/THIRD_PARTY_NOTICES.txt. The SDK ships its own R8/ProGuard rules for them; no keep rules are needed in your app.

Upgrading from 3.2.0 or earlier: if your build has exclude(group = "com.google.guava", module = "listenablefuture") (earlier SDKs needed it to avoid a duplicate ListenableFuture), remove it. The SDK no longer ships Guava's copy of that class, so the exclude now removes it entirely and WorkManager fails at runtime unless your app also depends on full Guava.

Platform: compileSdk 36, minSdk 29, Java 17.

1.1 Permissions (host responsibility) ​

The host app requests Bluetooth runtime permissions before any BLE operation (beginPairing / connect / syncDeviceData / firmware update / …). The SDK does not check or request permissions — a BLE call made without permission throws SecurityException. (Mirrors iOS, where the integrator supplies the usage strings and drives the prompt.)

Request at runtime:

  • Android 12+ (API 31+): BLUETOOTH_SCAN and BLUETOOTH_CONNECT. No location.
  • API < 31: ACCESS_FINE_LOCATION. (BLUETOOTH / BLUETOOTH_ADMIN are install-time permissions there, granted from the manifest — never requested at runtime.)

Location is only needed below Android 12. The SDK declares BLUETOOTH_SCAN with usesPermissionFlags="neverForLocation" (SB-1250), so on 12+ scan results are delivered without a location grant and with Location Services off. Below 12 there is no such flag: Android treats every BLE scan as location-deriving, so scans come back empty unless fine-location is granted and Location Services is turned on on the device. The SDK's manifest declares the BLE permissions; the grant is the host's to obtain. See ExampleApp/'s MainActivity/PairDeviceScreen for the request pattern.


Sensor Bio Mobile SDK — iOS & Android integration reference.