Integrating the Android SDK
Adding the Switchboard SDK to Your Project
You can add Switchboard SDK's in two ways
- Adding Swichboard SDK AAR via Maven
- Adding AAR directly into your project
Adding Swichboard SDK AAR via Maven and Gradle
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url "https://s3.amazonaws.com/synervoz-android-maven-repository" }
}
}
Then you can add the dependecy
dependencies {
implementation 'com.synervoz:switchboardsdk:1.10.0'
}
Adding AAR directly into 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'
}
Supported Architectures
The following architectures are supported:
armeabi-v7a
arm64-v8a
x86_64
Minimum OS version
The SDK requires Android 7.0 (API level 24) or later.
Permissions
To initialize the Switchboard SDK properly, you must add the INTERNET permission to your AndroidManifest.xml
file:
<uses-permission android:name="android.permission.INTERNET" />
Depending on your usecase, you may also need to add the following permissions to your app's manifest file:
// if your app uses the microphone
<uses-permission android:name="android.permission.RECORD_AUDIO" />
// if your app uses a bluetooth device
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
Initializing the SDK
You must initialize the Switchboard SDK before making any calls to it. The recommended place for this initialization is within the main application class, which extends Application()
, specifically in the onCreate
method. Ensure that you specify your application class in the <application>
tag of your app's AndroidManifest.xml
. Avoid initializing the SDK in MainActivity
, as this may cause issues.
To initialize our SDK in your project, please sign up here to receive your appID
and appSecret
values.
It is essential to initialize the Switchboard SDK before any other Extension.
- Kotlin
SwitchboardSDK.initialize("Your app ID", "Your app secret")