Sendbird UIKit for Android is a set of prebuilt UI components that allows you to easily craft an in-app chat with all the essential messaging features. Our development kit includes light and dark themes, text fonts, colors and more. You can customize these components to create an interactive messaging interface unique to your brand identity.
The minimum requirements for UIKit for Android are:
Android 4.1 (API level 16) or higher
Support androidx only
Gradle 3.5.4 or higher
You can start building a modern messaging experience in your app by installing Sendbird UIKit. This developer kit is an add-on feature to Sendbird Chat SDK so installing it will also install the core Chat SDK.
To get started, open
Android Studio and create a new project for 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.
- Enable Use androidx.*artifacts.
- Select minimum API level as 16 or higher.
You can install UIKit for Android through
Gradle. Begin by opening the root
build.gradle file and add the code blocks below:
Note: Make sure the code blocks above aren't added to your module
Next, open the
build.gradle file at the application level. For both
Kotlin, add the code blocks and dependencies as follows:
Before saving the
build.gradle file, check if you’ve enabled
dataBinding. Then, click the Sync button to apply all changes.
Note: UIKit SDK versions
2.1.1or lower can be downloaded from JCenter until February 1, 2022. SDK versions higher than
2.1.1will be available on Sendbird's remote repository.
A Sendbird application comprises everything required in a chat service including users, channels, and messages. To create an application:
- Go to the Sendbird Dashboard and enter your email and password to create a new account. You can also sign up with a Google account.
- When prompted by the setup wizard, enter your organization information to manage Sendbird applications.
- Then when your dashboard home appears after completing setup, click Create + at the top-right corner.
- Once you've created a new application, go to Users and click Create user + at the top-right corner. This step is necessary in order to create a group channel and send a message.
Only one Sendbird application can be integrated per app for your service regardless of the platform. All users within your Sendbird application can communicate with each other across all platforms. This means that your iOS, Android, and web client app users can send and receive messages with each other without any further setup. However, users in different Sendbird applications can't chat with each other since all data is limited to the scope of a single application.
To integrate and run Sendbird UIKit in your application, you need to initialize it first. You can initialize
SendBirdUIKit instance by passing the
SendBirdUIKitAdapter instance as an argument to a parameter in the
SendBirdUIKit.init() method. The
SendBirdUIKit.init() must be called once in the
onCreate() method of your client app’s
Add the created
ChannelListActivity is the starting point for launching UIKit in your application. By implementing the code below, you will see a complete list of group channels that you're a member of.
You can now run the application on an emulator or a plugged-in device. To send a message, you must first create a group channel by clicking on the icon in the top-right corner. Then, you can select users you wish to invite as members to your channel. Once the channel has been created, type your first message and press send.
You've successfully sent your first message with Sendbird.
Note: To customize your user list instead of retrieving the entire list from Sendbird server, set the custom user list query handler.
Methods provided by Sendbird UIKit for Android automatically process data using our Chat SDK. Using
Fragments, chat can easily be added to your Android client app using the components below.
This is the most important class in the UIKit. These interfaces can be used to initialize information and call all
Changes the theme to the default theme.
Determines whether the theme mode is
Retrieves the current registered
Imports your custom user list. If this isn’t implemented, the list of all users in the Sendbird server are displayed.
Connects to Sendbird server and update your profile.
Disconnects from Sendbird server.
Updates user information for profile display.
Sets the handler for common custom.
Returns the custom params handler.
Determines whether the user profile is used.
Returns the set value regarding the use of user profile.
Listed below are the methods of the
Retrieves the information of the current user
Retrieves the access token of the current user, which is required to provide in the
Listed below are the methods of the
Retrieves the ID of the current user that has been registered to Sendbird server.
Retrieves the current user's nickname. If the nickname hasn’t been set,
Retrieves the URL of the current user's profile image.
The UIKit also provides the following components. All components can be called while fragments and activities are running on the Android platform.
Shows all channels a user has joined.
Shows the current channel a user has joined. From this component, users can send or receive messages.
Shows all the users of your client app so you can create a channel. Users can be selected from this component to begin chatting.
Shows all the users of your client app from the current channel so you can invite other users to join.
Changes the channel information.
Shows the list of members in the current channel.
Shows the list of members in the current channel whom you can promote as an operator.
Shows the list of members who are banned from the current channel.
Shows the list of moderation options for the current channel.
Shows the list of members who are muted in the current channel.
Shows the list of members who are appointed as an operator in the current channel.