Setup - Android
Setting up android sdk
Android SDK is client for real-time communication for android devices. It inherits the same terminology as all other SDKs does.
Minimum OS/SDK versions
It supports the following OS/SDK versions.
Android: minSdkVersion >= 18
Installation
- If your Android Studio Version is older than Android Studio Bumblebees, add the repository to project's
build.gradlefile.
If your are using Android Studio Bumblebees or newer Version, add the repository tosettings.gradlefile.
- Android Studio Version < 2021.1.1
- Android Studio Version 2021.1.1
build.gradle
allprojects {
repositories {
// ...
maven { url 'https://jitpack.io' }
jcenter()
}
}
settings.gradle
dependencyResolutionManagement{
repositories {
// ...
maven { url 'https://jitpack.io' }
jcenter()
}
}
Step 2: Add the following dependency in your app's app/build.gradle.
app/build.gradle
dependencies {
implementation 'live.videosdk:android-sdk:0.0.26'
// library to perform Network call to generate a meeting id
implementation 'com.amitshekhar.android:android-networking:1.0.2'
// other app dependencies
}
Integration
Step 1: Add the following permissions in AndroidManifest.xml.
AndroidManifest.xml
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<!-- Needed to communicate with already-paired Bluetooth devices. (Legacy up to Android 11) -->
<uses-permission
android:name="android.permission.BLUETOOTH"
android:maxSdkVersion="30" />
<uses-permission
android:name="android.permission.BLUETOOTH_ADMIN"
android:maxSdkVersion="30" />
<!-- Needed to communicate with already-paired Bluetooth devices. (Android 12 upwards)-->
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
Step 2: Create MainApplication class which will extend the android.app.Application.
- Kotlin
- Java
MainApplication.kt
package live.videosdk.demo;
import live.videosdk.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.android.VideoSDK;
public class MainApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
VideoSDK.initialize(getApplicationContext());
}
}
Step 3: Add MainApplication to AndroidManifest.xml.
AndroidManifest.xml
<application
android:name=".MainApplication"
...
>
<!-- ... -->
</application>
Step 4: In your JoinActivity add the following code in onCreate() method.
- Kotlin
- Java
JoinActivity.kt
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_join)
val meetingId = "<meeting-id>"
val participantName = "John Doe"
var micEnabled = true
var webcamEnabled = true
// generate the jwt token from your api server and add it here
VideoSDK.config("JWT TOKEN GENERATED FROM SERVER")
// create a new meeting instance
meeting = VideoSDK.initMeeting(
this@MeetingActivity, meetingId, participantName,
micEnabled, webcamEnabled,false,null,null)
// get permissions and join the meeting with meeting.join();
// checkPermissionAndJoinMeeting();
}
JoinActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_join);
final String meetingId = "<meeting-id>";
final String participantName = "John Doe";
final boolean micEnabled = true;
final boolean webcamEnabled = true;
// generate the jwt token from your api server and add it here
VideoSDK.config("JWT TOKEN GENERATED FROM SERVER");
// create a new meeting instance
Meeting meeting = VideoSDK.initMeeting(
MainActivity.this, meetingId, participantName,
micEnabled, webcamEnabled,false,null,null
);
// get permissions and join the meeting with meeting.join();
// checkPermissionAndJoinMeeting();
}
All set! Here is the link to the complete sample code on Github. Please refer to the documentation for a full list of available methods, events and features of the SDK.
Got a Question? Ask us on discord

