Skip to main content
FieldValue
Kotlin (XML Views)com.cometchat:chat-uikit-kotlin v5.x
Jetpack Composecom.cometchat:chat-uikit-compose v5.x
InitCometChatUIKit.init(context, UIKitSettings, callback) — must resolve before login()
LoginCometChatUIKit.login("UID", callback) — must resolve before rendering components
Orderinit()login() → render. Breaking this order = blank screen
Auth KeyDev/testing only. Use Auth Token in production
ThemeSet CometChatTheme.DayNight as parent theme in themes.xml
CallingOptional. Add com.cometchat:calls-sdk-android to enable voice/video
Min SDKAndroid 7.0 (API 24)
This guide walks you through adding CometChat to an Android app. By the end you’ll have a working chat UI.

Prerequisites

You need three things from the CometChat Dashboard:
CredentialWhere to find it
App IDDashboard → Your App → Credentials
Auth KeyDashboard → Your App → Credentials
RegionDashboard → Your App → Credentials (e.g. us, eu, in)
You also need:
  • Android Studio installed
  • An Android emulator or physical device running Android 7.0 (API 24) or higher
  • Java 8 or higher
  • Gradle plugin 4.0.1 or later
Auth Key is for development only. In production, generate Auth Tokens server-side via the REST API and use loginWithAuthToken(). Never ship Auth Keys in client code.

Step 1 — Create an Android Project

  1. Open Android Studio and start a new project.
  2. Choose Empty Activity as the project template.
  3. Enter a project name and choose Kotlin as the language.
  4. Set minimum API level to 24 or higher.

Step 2 — Install Dependencies

Add the CometChat repository and dependencies to your Gradle configuration.

Add the CometChat Repository

Add the CometChat Maven repository to your project-level settings.gradle.kts file:
settings.gradle.kts
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven("https://dl.cloudsmith.io/public/cometchat/cometchat/maven/")
    }
}

Add the CometChat Dependency

Choose the module that matches your UI toolkit:
Inside libs.versions.toml, add the versions:
libs.versions.toml
[versions]
cometchat-ui-kit = "5.2.9"
cometchat-calls-sdk = "4.3.3"
Define the libraries — pick the module for your UI toolkit:
libs.versions.toml
[libraries]
cometchat-ui-kit = { module = "com.cometchat:chat-uikit-kotlin", version.ref = "cometchat-ui-kit" }
cometchat-calls-sdk = { module = "com.cometchat:calls-sdk-android", version.ref = "cometchat-calls-sdk" }
Now, in your app-level build.gradle.kts file:
build.gradle.kts
dependencies {
    implementation(libs.cometchat.ui.kit)

    // (Optional) Include if using voice/video calling features
    implementation(libs.cometchat.calls.sdk)
}

Add AndroidX Support

The Jetifier tool helps migrate legacy support libraries to AndroidX. Open gradle.properties and verify this line is present:
gradle.properties
android.enableJetifier=true

Choose Your UI Toolkit

The remaining integration steps (initialization, login, theming, and rendering components) differ depending on your chosen UI toolkit. Follow the guide that matches your project:

Kotlin (XML Views)

Step-by-step integration using chatuikit-kotlin with XML layouts and ViewBinding

Jetpack Compose

Step-by-step integration using chatuikit-jetpack with Composables

Build Your Own Chat Experience

Need full control over the UI? Use individual components, customize themes, and wire up your own layouts.

Sample App

Working reference app to compare against

Components

All prebuilt UI elements with customization options

Core Features

Messaging, real-time updates, and other capabilities

Theming

Colors, fonts, dark mode, and custom styling

Next Steps

Components Overview

Browse all prebuilt UI components

Theming

Customize colors, fonts, and styles

Core Features

Chat features included out of the box

Troubleshooting

Common issues and fixes