Setup
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
Step 1: Add the repo to project root's build.gradle
file.
build.gradle
allprojects {
repositories {
// ...
maven { url 'https://jitpack.io' }
}
}
Step 2: Add the following dependency in your app's app/build.gradle
:
app/build.gradle
dependencies {
implementation 'live.videosdk:android-sdk:0.0.8'
// 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.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
Step 2: Extend the android.app.Application
class and create MainApplication.java
class with the following code:
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: Also add MainApplication
to AndroidManifest.xml
AndroidManifest.xml
<application
android:name=".MainApplication"
...
>
<!-- ... -->
</application>
Step 4: In your MainActivity.java
add the following code in onCreate()
method:
MainActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
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
);
// 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