Integrating the Android SDK
Adding the Switchboard SDK to Your Project
Download the Android the SDK and copy the
SwitchboardSDK.aar
file to your project's folder. We recommend creating alibs
folder and placing the aar file there.Add the following to your module's
build.gradle
file:
dependencies {
implementation(files("libs/SwitchboardSDK.aar"))
}
Using with Android NDK
If your project contains native C++ code or you would like to access the native C++ part of the Switchboard SDK then add the following to your module's build.gradle
file also:
android {
defaultConfig {
externalNativeBuild {
cmake {
arguments "-DANDROID_STL=c++_shared"
}
}
}
buildFeatures {
prefab true
}
ndkVersion '24.0.8215888'
}
Permissions
Depending on your usecase, you may need to add the following permissions to your app's AndroidManifest.xml
file:
RECORD_AUDIO
: if your app uses the microphoneBLUETOOTH
,BLUETOOTH_ADMIN
,MODIFY_AUDIO_SETTINGS
: if your app uses a bluetooth device
If your app uses the microphone you need to indicate that in your app's AndroidManifest.xml
file and the RECORD_AUDIO
permission needs to be added.
Initializing the SDK
Before you make any calls to the Switchboard SDK you need to initialize it. You can do this anywhere in your project.
Please get in touch to get your clientID
and clientSecret
values.
- Kotlin
SwitchboardSDK.initialize("Your client ID", "Your client secret")