Sonde Health API Platform Documentation
Android SDK Initialization
๐ Module 1: SDK Initialization
Overview
This guide helps Android developers integrate the Passive SDK into their application. The following steps outline how to properly initialize the SDK in your Android app using your provided credentials.
ย
๐ Prerequisites
Before starting, ensure that:
You have access to your Client ID, Client Secret, and optionally Client Code (use null if unavailable).
Youโve added the Passive SDK to your project dependencies.
ย
๐งฉ Step 1: Import Required Classes
In your Application class, import the SDK initialization and callback interfaces:
import sonde_passive.client.SondeSdk
import sonde_passive.client.util.SondeInitCallback
ย
โ๏ธ Step 2: Initialize the SDK
Initialize the SDK inside the onCreate() method of your custom Application class. Make sure this is done after calling super.onCreate().
override fun onCreate() {
super.onCreate()
SondeSdk.voiceAnalysisEngine.init(
context = this,
clientId = "<YOUR CLIENT ID>",
clientSecret = "<YOUR CLIENT SECRET>",
clientCode = "<YOUR CLIENT CODE>", // Pass null if not applicable
callback = object : SondeInitCallback {
override fun onSuccess(msg: String) {
Log.d("SondeSDK", "Initialization successful: $msg")
}
override fun onError(error: Throwable) {
Log.e("SondeSDK", "Initialization failed: ${error.message}", error)
}
}
)
}
ย
๐ Notes
Client Code is optional. If you donโt have it, pass null.
Make sure the Application class is correctly registered in your AndroidManifest.xml.
Initialization must be done only once, typically during app startup.
Use Log.d and Log.e for better logging and debugging practices.
โ Next Steps
Continue with:
Sonde Health