Start your first live
Sendbird Live UIKit for Android is a set of prebuilt UI components that allows you to easily craft an in-app live stream with the essential streaming features including real-time chat. Our development kit includes UI components which you can customize to create an engaging live event experience for users.
Follow the guide below to start your live event with our easy-to-use UI components in Kotlin
and Java
. If you would like to build using the Live SDK only, refer to Sendbird Live SDK.
Try Live Studio
Live Studio is available on Sendbird Dashboard for you to try Sendbird Live in the quickest manner. You can use the Live Studio to test and demonstrate the functionalities to see what it's like to go live using Sendbird Live. Go to Sendbird Dashboard and create an application by selecting Calls+Live in product type and start Live Studio on the left navigation bar. Learn more about how to use it in this detailed guide.
Requirements
The minimum requirements for the Live UIKit for Android are:
- Android 5.0 (API level 21) or later
- Java 8 or higher
- Support androidx only
- Android Gradle plugin 4.0.1 or higher
Before you start
Sendbird Live UIKit is an add-on to Sendbird Live SDK which provides live streaming feature and uses open channels from Sendbird Chat SDK for chat. Installing Sendbird Live UIKit will automatically install the Live SDK and the Chat SDK.
Before installing the Live UIKit, create a Sendbird account to acquire an application ID which you will need to initialize the Live UIKit. Go to Sendbird Dashboard and create an application by selecting Calls+Live in product type. Once you have created an application, go to Overview and you will see the Application ID.
Get Started
You can start building your first live event by installing the Live UIKit. When you install the Live UIKit, Sendbird Live SDK will be installed implicitly.
Step 1 Create a project
To get started, open Android Studio
and create a new project for the Live UIKit in the Project window as follows:
-
Click Start a new Android Studio project in the Welcome to Android Studio window.
-
Select Empty Activity in the Select a Project Template window and click Next.
-
Enter your project name in the Name field in the Configure your project window.
-
Select your language as either Java or Kotlin from the Language drop-down menu.
-
Make sure Use legacy android.support.libraries is unchecked.
-
Select minimum API level as 21 or higher.
Step 2 Install the Live UIKit
You can install the Live UIKit for Android through Gradle
. If you're using Gradle 6.7 or lower, add the following code to your root build.gradle
file.
Note: Make sure the above code block isn't added to your module
build.gradle
file.
If using Gradle 6.8 or higher, add the following to your settings.gradle
file.
Note: To learn more about updates to Gradle, visit this page.
Next, for all Gradle versions, open the build.gradle
file at the application level. For both Java
and Kotlin
, add the following code block and dependencies.
Before saving the build.gradle
file, check if you’ve enabled viewBinding
. Then, click the Sync button to apply all changes.
Note: If you've already been using Sendbird Chat or you want to know the minimum version of the Chat SDK to use the Live UIKit, you can check the information in Sendbird Live SDK.
Step 3 Request permission to access camera and microphone
Your users need to grant the client app the permission to access camera and microphone to stream media. They also need to allow access to the photo library to send and download images and videos.
Note: For more information about requesting app permissions, see the Android’s Request runtime permissions guide.
Step 4 Initialize the SendbirdLiveUIKit instance
To integrate the Live SDK in the client app, you need to initialize it first. You can initialize the SendbirdLiveUIKit
instance by passing the SendbirdUIKitAdapter
instance as an argument to a parameter in the SendbirdLiveUIKit.init()
method. SendbirdLiveUIKit.init()
must be called once in the onCreate()
method of your app’s authentication Activity
instance.
Step 5 Display a live event list
Launch the Live UIKit in the client app with LiveEventListActivity
, which serves as the starting point for using the Live UIKit to create, enter, and list live events. Implement the code below to start the Live UIKit wherever you would like in the client app.
Step 6 Start your first live
You can now run the app on a simulator or a plugged-in device. To start a live event, you must first create a live event by tapping the button in the top-right corner. Add a title, a cover image, and users who can be a host or else the default values will show. Once you have created a live event, tap on the live event to enter. You can choose to enter as a host or a participant and other users can enter the live event as participants.
You can also enter a live event manually as shown below.
You've successfully started your first live event with Sendbird Live.