Getting Started - Android SDK
Android SDK is natively written SDK using Java. It is compatible with both Java and Kotlin.
Install an Android SDK​
The easiest way to get started is by installing the sdk in your app.
Step 1: Add the repositories into your project.​
- If your Android Studio Version is older than Android Studio Bumblebees, add the repository to project's
build.gradle
file. - If your are using Android Studio Bumblebees or newer Version, add the repository to
settings.gradle
file.
note
You can use imports with Maven Central after rtc-android-sdk version 0.1.12
.
Whether on Maven or Jitpack, the same version numbers always refer to the same SDK.
- Maven Central
- Jitpack
build.gradle
allprojects {
repositories {
// ...
google()
mavenCentral()
maven { url "https://maven.aliyun.com/repository/jcenter" }
}
}
settings.gradle
dependencyResolutionManagement{
repositories {
// ...
google()
mavenCentral()
maven { url "https://maven.aliyun.com/repository/jcenter" }
}
}
build.gradle
allprojects {
repositories {
// ...
google()
maven { url 'https://jitpack.io' }
mavenCentral()
maven { url "https://maven.aliyun.com/repository/jcenter" }
}
}
settings.gradle
dependencyResolutionManagement{
repositories {
// ...
google()
maven { url 'https://jitpack.io' }
mavenCentral()
maven { url "https://maven.aliyun.com/repository/jcenter" }
}
}
Step 2: Add the dependency in app/build.gradle
:​
app/build.gradle
dependencies {
implementation 'live.videosdk:rtc-android-sdk:0.1.38'
// other app dependencies
}
important
Android SDK compatible with armeabi-v7a, arm64-v8a, x86_64 architectures. If you want to run the application in an emulator, choose ABI x86_64 when creating a device.
Step 3: Add all the following permissions to AndroidManifest.xml​
AndroidManifest.xml
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
Step 4: Create MainApplication class with the following code​
- Kotlin
- Java
MainApplication.kt
package live.videosdk.demo;
import live.videosdk.rtc.android.VideoSDK;
class MainApplication : Application() {
override fun onCreate() {
super.onCreate()
VideoSDK.initialize(applicationContext)
}
}
MainApplication.java
package live.videosdk.demo;
import android.app.Application;
import live.videosdk.rtc.android.VideoSDK;
public class MainApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
VideoSDK.initialize(getApplicationContext());
}
}
Step 5: Add MainApplication to AndroidManifest.xml​
AndroidManifest.xml
<application
android:name=".MainApplication"
>
<!-- ... -->
</application>
note
Check out official example of Android SDK implementation for Java and Kotlin as mentioned below:
- For Java Code Sample Click here
- For Kotlin Code Sample Click here
Got a Question? Ask us on discord