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.
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.
In your Application class, import the SDK initialization and callback interfaces:
import sonde_passive.client.SondeSdk
import sonde_passive.client.util.SondeInitCallback
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) } } ) } |
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.
Continue with: