Follow this step-by-step guide to set up the Sinch Voice and Video SDK for the first time.
- Register a Sinch Developer account here.
- Set up a new application in the Dashboard to obtain an Application Key and an Application Secret.
Download the Sinch SDK from the SDK Downloads page. It includes the AAR library, this user guide, reference documentation, and sample apps for calling.
The Sinch SDK library is distributed in AAR format. To use it in your project either:
- Copy the
.aarfile to thelibsfolder and edit thebuild.gradlefile to include:
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
implementation(name:'sinch-android-rtc', version:'+', ext:'aar')
}
- Or, in Android Studio, choose
File → New → New Module → Import .JAR/.AAR Package.
Alternatively, you can consume the SDK from Maven Central. See the Android SDK artifact and Gradle instructions in the SDK Downloads page.
If you use ProGuard/R8, we bundle an example proguard-project.txt that ensures the Sinch SDK works as expected.
A minimum set of permissions is needed for the app to use the Sinch SDK. Specify these in the AndroidManifest.xml file.
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CAMERA"/>By default, the Sinch SDK hangs up any Sinch call if the regular phone app has an active call. This functionality requires the permission android.permission.READ_PHONE_STATE.
If you do not want this behavior, disable it by calling SinchClient.callController.setRespectNativeCalls(false) and you can remove the READ_PHONE_STATE permission.
If you intend to use Automatic Audio Routing (see the Voice Calling section), you must add android.permission.BLUETOOTH in the manifest and ensure the user has granted this permission.
To verify that the manifest has the necessary permissions, use SinchClient.checkManifest(). It checks whether required permissions are granted by the user at runtime. Examples of dynamically requesting missing permissions are included in the sample apps that come with the SDK.
Note: This method considers the features enabled for the app (for example, calling, respecting native calls). Call SinchClient.checkManifest() after setup but before starting the SinchClient.