Skip to main content

Android Requirements and SDK Setup

SDK Version: 1.0.0
Platform: Android

1. Build baseline

ItemRequirement
AndroidminSdk 26 or later
Compile referencecompileSdk 36
Java/KotlinJDK 17 and Kotlin JVM target 17
DeviceA physical BLE-capable Android device with Bluetooth enabled

2. Add the Release delivery

Obtain the formal SDK 1.0.0 Release AARs, dependency manifest, checksums, and shrinker rules through the agreed delivery channel. The documentation ZIP does not contain AARs. Do not ship test artifacts.

Select only the delivered products required by the application:

SDK productDelivery modulePrimary entry point
BLEble-sdkXTalkBleClient
Channel Presencechannel-presence-sdkChannelPresenceScanSdk
Device Authdevice-auth-sdkDeviceAuthenticator
Device Initdevice-init-sdkDeviceInitializer
Meshmesh-sdkMeshSdk
Low Latency PTTlow-latency-ptt-sdkLowLatencyPttSdk
OTAota-sdkXTalkTurMassOtaManager / XTalkBluetoothFotaManager
Radio Transportradio-transport-sdkRadioTransport
STTstt-sdkXTalkStt
UARTuart-sdkXTalkUartClient / UartRadioTransport

Place all delivered AARs in the application module's libs directory:

dependencies {
implementation(fileTree("libs") { include("*.aar") })
}

Groovy:

dependencies {
implementation fileTree(dir: "libs", include: ["*.aar"])
}

An AAR does not necessarily embed every external dependency. Add every dependency listed in the delivery manifest and keep all AARs on the same SDK version. Core products are delivered as formal AARs by default; when the manifest provides a customer-only Maven repository, use its repository URL, credentials, and coordinates. This manual does not publish a public repository URL.

For example, Mesh over BLE requires the Mesh and BLE deliveries plus the transitive dependencies in their manifests. Low Latency PTT also requires a transport and the delivered audio-codec integration. Do not integrate by copying SDK source files.

3. Manifest and runtime permissions

<uses-feature android:name="android.hardware.bluetooth_le" android:required="true" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Required only for voice capture -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
  • Android 12/API 31+: request BLUETOOTH_SCAN and BLUETOOTH_CONNECT at runtime.
  • Android 11/API 30 and earlier: scanning requires ACCESS_FINE_LOCATION.
  • RECORD_AUDIO is needed only for PTT/realtime capture; BLE, AT, RF, text, and file operations do not require it.
  • Request POST_NOTIFICATIONS only if the customer application actually posts notifications and the OS requires it.

Permission helpers:

val blePermissions = requiredBluetoothPermissions()
val bleGranted = hasBluetoothPermissions(context)

// BLE + recording + notification where applicable; for applications enabling every capability.
val allStartupPermissions = requiredStartupPermissions()
val allGranted = hasStartupPermissions(context)

The helpers calculate and check permissions; they do not show the system permission dialog. The Activity or Fragment must request permissions through the Activity Result API and must not scan or record after denial.

4. Initialize and check the result

Call this from Application.onCreate() or before entering the BLE feature for the first time:

XTalkBleClient.setApplicationContext(applicationContext)
val result = XTalkBleClient.ensureInitialized()
check(result == InitResult.INIT_OK) { "xTalk initialization failed: $result" }

setApplicationContext retains only the application context. ensureInitialized is idempotent. Do not scan when the returned value is not INIT_OK.

5. Release/R8 checklist

  1. Use the consumer/ProGuard rules in the delivery manifest; do not guess class keep rules.
  2. Verify that every AAR, external dependency, and ABI file is present.
  3. Run scan, connect, Auth, Init, and traffic smoke tests on the minified Release variant.
  4. If only Release fails, retain the full stack trace, device model, and OS version for xTalk support. Do not hide the issue by disabling all shrinking.

Next: BLE Connection SDK