Android SDK
Android SDK has two dependencies: okhttp and gson. You can check the levels of dependencies according to the Android SDK version directly in the Maven. Note that there could be a delay between the last release and appearance in Maven’s searching index.
Adding SDK to your application
- Modify build.gradle file that is located at the root level of your project to add mavenCentral() to repositories list:
allprojects {
repositories {
jcenter()
mavenCentral() //add this line
}
}
- Edit build.gradle and add voximplant-sdk as compile files target in the dependencies section. Paste the actual version from the changelog:
dependencies {
...
// Paste the actual version from the changelog
implementation 'com.voximplant:voximplant-sdk:2.16.1'
}
- Since version 2.5.0, it is required to add Java 8 support to your project in build.gradle file:
android {
... //other configs
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
Initializing SDK
Your application will require the following permissions. They will be automatically merged to AndroidManifest by adding Android SDK as compile dependencies.
Bear in mind that CAMERA and RECORD_AUDIO permissions need to be prompted to a user since Android 6.0 (use the Voximplant.getMissingPermissions method to see the permissions that are not granted by the user).
Create the new singleton of type IClient and initialize it as specified in the documentation:
Connect and Log In
Then you need to connect to the cloud and authorize the user. The IClient.connect and IClient.login methods handle with it. You also have to set the appropriate listeners to handle the connection and authentication results: IClientSessionListener and IClientLoginListener. For example, you can connect to the cloud and login user myuser to application myapp in your Voximplant account named myaccount with password mypass: