Skip to main content
This guide walks you through integrating the CometChat Kotlin UI Kit into an Android app using XML Views and View Binding. By the end you’ll have a working chat UI.

Prerequisites

You need three things from the CometChat Dashboard: You also need:
  • Android Studio installed
  • An Android emulator or physical device running Android 9.0 (API 28) or higher
  • Kotlin configured in your project
  • Gradle plugin 8.0+ with Kotlin DSL
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. Select Kotlin as the language.
  4. Set minimum API level to 28 or higher.

Step 2 — Install Dependencies

Add the CometChat Repository

Add the CometChat Maven repository to your settings.gradle.kts:
settings.gradle.kts

Add Dependencies

Open your app-level build.gradle.kts and enable View Binding, then add the dependencies:
build.gradle.kts

Add AndroidX Support

Verify this line is present in gradle.properties:
gradle.properties

Step 3 — Initialize and Login

Create your MainActivity.kt with the CometChat initialization and login flow:
MainActivity.kt
init() must resolve before you call login(). Calling login() before init completes will fail silently.

Step 4 — Choose a Chat Experience

Integrate a conversation view that suits your app’s UX. Each option below includes a step-by-step guide.

Conversation List + Message View

Sequential navigation — conversation list as the entry point, tap a conversation to open a full-screen message view.

Build Conversation List + Message View

Step-by-step guide to build this layout with Kotlin XML Views

One-to-One / Group Chat

Single chat window — no sidebar. Loads a specific user or group chat directly. Ideal for support chat, direct messages, or notification-driven flows.

Build One-to-One / Group Chat

Step-by-step guide to build this layout

Tab-Based Chat

Bottom navigation with tabs for Chats, Calls, Users, and Settings.

Build Tab-Based Chat

Step-by-step guide to build this layout

Next Steps

Components Overview

Browse all available UI Kit components

Theming

Customize colors, fonts, and styles

Core Features

Chat features included out of the box

Troubleshooting

Common issues and fixes