Android Core SDK Quickstart
This quickstart shows how to use Dyte's Android Core SDK to add live video and audio to your Android applications.
For getting started quickly, you can use our sample code. You can clone and run a sample application from the Android Core SDK GitHub repository.
Objective
You'll learn how to:
- Install the Dyte SDK
- Initialize the SDK
- Configure a Dyte meeting
- Initialize the Dyte meeting
- And go live with your Dyte meeting
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 using maven central
dependencies {
// (other dependencies)
implementation 'io.dyte:core-android:+'
}
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
}
}
dependencies {
// other dependencies
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
}
Step 2: Initialize the SDK
The DyteMobileClient
is the main class of the SDK. It is the entry point and
the only class required to initialize Dyte SDK.
val dyteClient = DyteMeetingBuilder.build(activity)
Step 3: Set the meeting properties
Set the properties in the DyteMeetingInfoV2
class. You just need to provide the
participant's authToken
.
Name | Description | |
---|---|---|
authToken | After you've created the meeting, add each participant to the meeting using the Add Participant API (The presetName created earlier must be passed in the body of the Add Participant API request) The API response contains the authToken . |
val meetingInfo = DyteMeetingInfoV2(
authToken = "<auth_token>",
)
Step 4: Initialize the connection request
To initialize the connection request, call the init()
method obtained on
dyteClient
with the meetingInfo
argument. This will establish the connection
with the Dyte meeting server.
dyteClient.init(meetingInfo, {
// init complete
}, {
// init failed
}
)
Step 5: Connect to the meeting
Now, you have established the connection with the Dyte meeting server successfully. Next step is to join the room.
Join the room
To join the meeting room, call joinRoom()
method on the dyteClient
instance
as shown below.
dyteClient.joinRoom({
// meeting room joined
}, {
// error in joining the meeting
})
Leave the room
Once the meeting is over, you can leave the meeting room.
To leave the meeting room, call leaveRoom()
method on the dyteClient
as
shown below.
dyteClient.leaveRoom({
// leave completed
}, {
// leave failed
})