Skip to main content

High-level Facades

The Plaud Embedded Android SDK has two high-level interfaces:
  1. PlaudDeviceAgent: a Kotlin object you call statically
  2. IWifiTransferAgent: the WiFi Fast Transfer session and file operations
These high-level methods and callbacks should cover most use cases including:
  1. Device Connection: Connecting to & disconnecting from Plaud devices via mobile app
  2. File Management: Syncing files from Plaud device to mobile app
  3. Firmware Updates: Updating Plaud device firmware
See our Android SDK reference for examples and documentation on these high-level facades.
Additionally, using PlaudDeviceAgent abstracts many details that low-level interfaces will not handle.
You can mix the high-level and low-level facades. For example if there’s a behavior that PlaudDeviceAgent does not include, you can use IBleAgent to cover that functionality.

Low-level Facades

The Android SDK has a few lower-level interfaces that PlaudDeviceAgent wraps over:
  1. IBleAgent: the BLE protocol library
  2. NiceBuildSdk: helper SDK for crypto and cloud API calls
  3. PartnerApiManager: manages the backend endpoints for device signing and RSA keypair generation
We do not recommend using these low-level facades as main drivers. Use them as coverage for functionality not exposed by PlaudDeviceAgent.

IBleAgent Reference

IBleAgent is the raw BLE transport, reached through the protocol library’s TntAgent singleton:
Kotlin
It exposes 165 methods — roughly four times the facade’s surface — so most device features the SDK supports but PlaudDeviceAgent doesn’t expose are reachable here.

The callback convention

Every IBleAgent command takes an OnRequest / OnResponse pair instead of reporting to a global listener.
Kotlin
OnRequest fires when the command is written to the device; OnResponse fires when the device answers. A successful OnRequest with no OnResponse means the device accepted the command but never replied.

Device Connection

Kotlin
BleDevice
required
The device to connect to, as delivered by scanBleDeviceReceiver(...).
String
required
Parsed from the user JWT’s sub claim. NiceBuildSdk.resolveHandshakeToken(...) does this for you — the facade calls it internally.
String
required
Per-device token. This is the value PlaudDeviceAgent.connectBleDevice(bleDevice, deviceToken) forwards; pass "" for the no-token overload.
String
required
Owner name written to the device. The facade passes "" (iOS passes "Plaud").
Boolean
required
Clear any existing pairing before connecting. The facade passes false.

Recording & Device State

Kotlin
IBleAgent also exposes the full device-settings surface the facade only partially wraps. Each setting is a get… / set… pair.
Kotlin

File Sync

Kotlin
Long
required
The session ID to start listing from. 0 lists everything.
Long
required
The recording to sync or delete.
Long
required
Start byte offset. Use 0 for the whole file, or resume from a prior offset.
Long
required
End byte offset. 0 transfers to the end of the file.
ISyncVoiceDataKeepOut
required
Receives streamed audio bytes. Build one with VoiceDataCreatorFactory.newOriginalData() to write raw device bytes to a file. PlaudDeviceAgent handles this.
There is no format conversion and no decryption at this layer — the collector receives exactly what the device sends. PlaudDeviceAgent.exportAudio(...) handles this conversion and decryption.

Firmware Push

Kotlin
FirmwareUpdateManager composes the full flow on top of this from querying the version to MD5 verification, CRC, and the post-restart reconnect.
Android’s firmware version check queries GET /api/sdk/latest-version with an Authorization header, while iOS uses the partner endpoint with X-Device-Signature.

BleAgentListener

IBleAgent’s listener is registered on TntAgent:
Kotlin
Conforming to BleAgentListener means implementing 27 members, and it hands you undocumented protocol response types instead of primitives. Unless you need an event the facade doesn’t re-emit, keep your listener on PlaudDeviceAgentListener.
Events available only on BleAgentListener:

PartnerApiManager

PartnerApiManager wraps the partner authentication endpoints. Like IBleAgent, reach it via the lower facade:
Kotlin
Kotlin

Device Security

Partner endpoints for device authentication:
1

Wait for the RSA key pair — gen-key

initSDK(...) fetches the key pair asynchronously. Poll isPartnerDataReady() before connecting.
Kotlin
Or, without a coroutine, use the callback form:
Kotlin
2

Sign the device SN — sn-sign

signAndStoreDeviceSn(...) signs the SN and writes the result where the BLE layer reads it during the pre-handshake.
Kotlin
String
required
Device family, derived from the first three characters of the serial number.
String
required
Device serial number, from BleDevice.getSerialNumber().
3

Connect

Kotlin
The SN signature is stored in memory only — there is no Keystore-backed cache and no persistence across process death. Every fresh launch needs a live sn-sign call before its first connect, so the device requires network reachability at that moment. Re-sign as a fallback whenever the stored signature is missing.
The RSA key pair itself is persisted, wrapped by an AES master key in the Android Keystore, and is what feeds audio E2EE decryption:
Kotlin
NiceBuildSdk.bindDevice(...) / unbindDevice(...) are not the cloud bind documented in the Android SDK reference. They post to a different service (/api/devices/bind) with a different credential. For the documented flow, call developer/api/open/partner/sdk/bind directly with the user token.