Android Java UI Kit

Learn a quick integration of text chat and voice/video calling features for your application

The CometChat Android Java UI Kit is developed to keep developers in mind and aims to reduce development efforts significantly.


Improvements in V3.0

Faster connection & response times
Higher rate limits
Supports up to 100K users in a group
Unlimited groups
Support for Transient Messages
Real-time user & group members count
And more!

The UI Kit’s customizable UI components simplify the process of integrating text chat and voice/video calling features to your website or mobile application in a few minutes.

I want to checkout Android Java UI Kit.

Follow the steps mentioned in the file.

Kindly, click on below button to download our Android Java Chat UI Kit.

Java Chat UI Kit

View on Github

I want to explore sample apps.

Import the app into Android Studio and follow the steps mentioned in the file.

Kindly, click on below button to download our Java Sample App.

Java Sample App

View on Github

Installation Steps


Before you begin, ensure you have met the following requirements:
✅   You have Android Studio installed in your machine.
✅   You have a Android Device or Emulator with Android Version 6.0 or above.
✅   You have read CometChat Key Concepts.

Installing Android Java Chat UI Kit

Setup :wrench:

To setup Android Chat UI Kit, you need to first register on CometChat Dashboard. Click here to sign up.

i. Get your Application Keys :key:

  1. Create a new app: Click Add App option available → Enter App Name & other information → Create App



Please follow the steps provided in the Key concepts guide to create V3 apps before you proceed.

  1. You will find APP_ID, AUTH_KEY and REGION key at the top in QuickStart section or else go to "API & Auth Keys" section and copy the APP_ID, API_KEY and REGION key from the "Auth Only API Key" tab.

ii. Add the CometChat Dependency

Step 1 - Add the repository URL to the project level build.gradle file in the repositories block under the allprojects section.

allprojects {
  repositories {
    maven {
      url ""

Step 2- Open the app level build.gradle file and follow below

  1. Add the below line in the dependencies section.
dependencies {
  implementation 'com.cometchat:pro-android-chat-sdk:3.0.1'
   implementation 'com.cometchat:pro-android-calls-sdk:2.1.0'



From v2.4+ onwards, Voice & Video Calling functionality has been
moved to a separate library. In case you plan to use the calling
feature, please add the Calling dependency.

  1. Add the below lines android section
android {
  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8

You can refer to the below link for instructions on how to do so:

📝 Add CometChat Dependency

Configure CometChat SDK

i. Initialize CometChat 🌟

The init() method initializes the settings required for CometChat. We suggest calling the init() method on app startup, preferably in the onCreate() method of the Application class.

String appID = "APP_ID"; // Replace with your App ID
String region = "REGION"; // Replace with your App Region ("eu" or "us")
String authKey = "AUTH_KEY"; //Replace with your Auth Key.

AppSettings appSettings=new AppSettings.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(region).build();

CometChat.init(this, appID,appSettings, new CometChat.CallbackListener<String>() {
  public void onSuccess(String successMessage) {
    Log.d(TAG, "Initialization completed successfully");
  public void onError(CometChatException e) {
    Log.d(TAG, "Initialization failed with exception: " + e.getMessage());

:bulb: Tip: UIKitSettings.setAuthKey(String authKey) is used to pass the Auth Key to uiKit library.



Make sure to replace region and appID with your credentials in the above code snippet.

ii. Login User 👤

Once you have created the user successfully, you will need to log the user into CometChat using the login() method.

String UID = "user1"; // Replace with the UID of the user to login
String authKey = "AUTH_KEY"; // Replace with your App Auth Key

 if (CometChat.getLoggedInUser() == null) {
     CometChat.login(UID, authKey, new CometChat.CallbackListener<User>() {

      public void onSuccess(User user) {
        Log.d(TAG, "Login Successful : " + user.toString());

    public void onError(CometChatException e) {
        Log.d(TAG, "Login failed with exception: " + e.getMessage());
 } else {
   // User already logged in



  • The login() method needs to be called only once.
  • Replace AUTH_KEY with your App Auth Key in the above code snippet

📝 Please refer to our SDK Documentation for more information on how to configure the CometChat Pro SDK and implement various features using the same.

Add UI Kit Library

To integrate the UI Kit, please follow the steps below:

  1. Clone the UI Kit Library from the android-chat-ui-kit repository or
  1. Import uikit Module from Module Settings.( To know how to import uikit as Module visit this link )

  2. If the Library is added sucessfully, it will look like mentioned in the below image.

Configure UI Kit Library

To use UI Kit you have to add Material Design support in your app as the UI Kit uses Material Design Components.

  • Add Material Design Dependency in build.gradle
    dependencies {
      implementation '<version>'
  • Make sure that your app's theme should extend `Theme.MaterialComponents`. Follow the guide on [Getting started Material Components](
    The following is the list of Material Components themes you can use to get the latest component styles and theme-level attributes.
    `Theme.MaterialComponents.NoActionBar`  </br>
    `Theme.MaterialComponents.Light.NoActionBar` </br>
    `Theme.MaterialComponents.DayNight.NoActionBar` </br>
    Update your app theme to inherit from one of these themes, e.g.:
    <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar.Bridge">
            <!-- Customize your theme here. -->


Enable DataBinding

As the UI Kit uses DataBinding you must enable DataBinding

To configure your app to use data binding, add the dataBinding element to your build.gradle file in the app module, as shown in the following example:

android {
    dataBinding {
        enabled = true



We are using File Provider for storage & file access. So you need to add your application package name in manifestPlaceholders

android {
        defaultConfig {

            manifestPlaceholders = [file_provider: "YOUR_PACKAGE_NAME"] 
            //add your application package.

Launch CometChat UI :rocket:

CometChatUI is a way to launch a fully working chat application using the UI Kit .In UI Unified all the UI Screens and UI Components working together to give the full experience of a chat application with minimal coding effort.*

To use CometChatUI user has to launch CometChatUI class. Add the following code snippet to launch CometChatUI.

startActivity(new Intent(YourActivity.this,CometChatUI.class))

What’s Next
Did this page help you?