Installation#

This guide explains how to add the BrainAccessKit SDK (version 2.2.0) to your Android project.

Unlike the 1.0.0 release, the SDK is not published to any Maven repository — there is no JitPack coordinate. It ships as a single self-contained ZIP of prebuilt artifacts that you drop into your app and reference directly.

Getting the SDK#

Obtain BrainAccessKit-2.2.0.zip and unzip it. It contains:

  • libs/ — the SDK artifacts (see the table below).

  • Examples/MinimalGUI/ — a complete, buildable example app (see Examples).

  • A consume guide (README.md) and the licence (LICENSE.md).

libs/ contents#

File

Required

Purpose

protocol-2.2.0.jar

yes

Wire codec + configuration types (pure JVM).

core-release.aar

yes

BrainAccessClient, DeviceSession, config store, typed EEG output.

transport-android-release.aar

yes

Nordic-backed BLE transport (NordicTransport).

lsl-release.aar

LSL only

Lab Streaming Layer outlet adapter.

liblsl-Java-release.aar

LSL only

liblsl native library (arm64-v8a, armeabi-v7a, x86, x86_64).

1. Add the artifacts to your module#

Copy everything from the ZIP’s libs/ folder into your app module’s libs/ directory.

2. Add the SDK dependency#

The loose .aar / .jar files carry no dependency metadata, so reference them with a fileTree and declare the external Maven dependencies they need yourself. In your module’s build.gradle.kts:

dependencies {
    implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.aar", "*.jar"))))

    // The loose .aar/.jar above carry NO dependency metadata, so declare these
    // yourself (Gradle resolves their transitives, including AndroidX):
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
    implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
    implementation("no.nordicsemi.android:ble:2.9.0")       // transport-android
    implementation("no.nordicsemi.android:ble-ktx:2.9.0")   // transport-android
}

If you do not use LSL, omit lsl-release.aar and liblsl-Java-release.aar from libs/; the kotlinx and Nordic dependencies above still apply.

Requirements#

  • Kotlin 2.0.x

  • minSdk 24, compileSdk 36 or newer

  • AndroidX enabled (android.useAndroidX=true in gradle.properties)

Permissions#

The SDK declares the BLE permissions its transport needs (they merge into your app’s manifest), but it never requests them at runtime — that is your app’s responsibility. The declared set is:

<!-- API 31+ -->
<uses-permission
    android:name="android.permission.BLUETOOTH_SCAN"
    android:usesPermissionFlags="neverForLocation" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

<!-- API <= 30 -->
<uses-permission
    android:name="android.permission.BLUETOOTH"
    android:maxSdkVersion="30" />
<uses-permission
    android:name="android.permission.BLUETOOTH_ADMIN"
    android:maxSdkVersion="30" />
<uses-permission
    android:name="android.permission.ACCESS_FINE_LOCATION"
    android:maxSdkVersion="30" />

Request the runtime set for the OS you are running on:

  • API 31+ (Android 12+): BLUETOOTH_SCAN + BLUETOOTH_CONNECT.

  • API ≤ 30: ACCESS_FINE_LOCATION, and the phone’s location services must be ON to receive scan results (otherwise the SDK reports BrainAccessError.LocationOff).

The exact set required for the running OS is available programmatically via com.neurotec.brainaccess.transport.BlePermissions.required. For more on requesting runtime permissions, see the official Android documentation.