Android Requirements and SDK Setup
SDK Version: 1.0.0
Platform: Android
1. Build baseline
| Item | Requirement |
|---|---|
| Android | minSdk 26 or later |
| Compile reference | compileSdk 36 |
| Java/Kotlin | JDK 17 and Kotlin JVM target 17 |
| Device | A 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 product | Delivery module | Primary entry point |
|---|---|---|
| BLE | ble-sdk | XTalkBleClient |
| Channel Presence | channel-presence-sdk | ChannelPresenceScanSdk |
| Device Auth | device-auth-sdk | DeviceAuthenticator |
| Device Init | device-init-sdk | DeviceInitializer |
| Mesh | mesh-sdk | MeshSdk |
| Low Latency PTT | low-latency-ptt-sdk | LowLatencyPttSdk |
| OTA | ota-sdk | XTalkTurMassOtaManager / XTalkBluetoothFotaManager |
| Radio Transport | radio-transport-sdk | RadioTransport |
| STT | stt-sdk | XTalkStt |
| UART | uart-sdk | XTalkUartClient / 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_SCANandBLUETOOTH_CONNECTat runtime. - Android 11/API 30 and earlier: scanning requires
ACCESS_FINE_LOCATION. RECORD_AUDIOis needed only for PTT/realtime capture; BLE, AT, RF, text, and file operations do not require it.- Request
POST_NOTIFICATIONSonly 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
- Use the consumer/ProGuard rules in the delivery manifest; do not guess class keep rules.
- Verify that every AAR, external dependency, and ABI file is present.
- Run scan, connect, Auth, Init, and traffic smoke tests on the minified Release variant.
- 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.