Quickstart
This quickstart shows how to use Dyte's Android UI Kit SDK to add live video and audio to your Android applications.
To get started quickly, you can use our sample code. Simply clone and run a sample application from the Android UIKit samples, available in both Kotlin and Java.
Objective
You'll learn how to:
Before Getting Started
Make sure you've read the Getting Started with Dyte topic and completed the steps in the Integrate Dyte section. You must complete the following steps:
- Create a Dyte Developer Account
- Create a Dyte Meeting
- Add Participant to the meeting
- Install Android Studio
Step 1: Install the SDK from MavenCentral
dependencies {
// (other dependencies)
implementation 'io.dyte:uikit:+'
}
If your app targets to lower versions of android (android api <= 24), Please enable core desugering in your app's build.gradle file like follows.
android {
// other configurations
compileOptions {
// other configurations
isCoreLibraryDesugaringEnabled = true
// Sets Java compatibility to Java 8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
dependencies {
// other dependencies
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
}
Step 2: Configure a Dyte meeting
Configure the following properties in the DyteMeetingInfoV2
class. You must pass a valid participant authToken
obtained from the Add Participant API.
Name | Description |
---|---|
authToken | Authentication token generated using the Add Participant API after meeting creation. |
enableAudio | Set whether to join the meeting with your Mic ON (true ) or OFF (false ). |
enableVideo | Set whether to join the meeting with your Camera ON (true ) or OFF (false ). |
baseUrl | Base URL of the Dyte environment you have created the meeting on. |
- Kotlin
- Java
val meetingInfo = DyteMeetingInfoV2(
authToken = "<auth_token>",
enableAudio = true,
enableVideo = true,
baseUrl = "dyte.io"
)
DyteMeetingInfoV2 meetingInfo = new DyteMeetingInfoV2(
"<auth_token>",
true, // enableAudio
true, // enableVideo
"dyte.io"
);
Step 3: Initialize the SDK
Initialize the DyteUIKit with the DyteUIKitBuilder
class, using the meetingInfo
configured above.
- Kotlin
- Java
val dyteUIKitInfo = DyteUIKitInfo(
activity = this,
dyteMeetingInfo = meetingInfo
)
val dyteUIKit = DyteUIKitBuilder.build(dyteUIKitInfo)
DyteUIKitInfo dyteUIKitInfo = new DyteUIKitInfo(this, meetingInfo);
DyteUIKit dyteUIKit = DyteUIKitBuilder.build(dyteUIKitInfo);
Step 4: Launch the meeting UI
To launch the meeting UI all you need to do is call startMeeting()
which will take
care of everything for you.
- Kotlin
- Java
dyteUIKit.startMeeting()
dyteUIKit.startMeeting();