AI Integration Quick Reference
AI Integration Quick Reference
| Field | Value |
|---|---|
| Package | com.cometchat:chatuikit-compose-android |
| UI Layer | Jetpack Compose (Material 3) |
| Init | CometChatUIKit.init(context, UIKitSettings, callback) — must resolve before login() |
| Login | CometChatUIKit.login("UID", callback) — must resolve before rendering components |
| Order | init() → login() → render. Breaking this order = blank screen |
| Auth Key | Dev/testing only. Use Auth Token in production |
| Calling | Optional. Add com.cometchat:calls-sdk-android to enable voice/video |
| Min SDK | Android 9.0 (API 28) |
Prerequisites
You need three things from the CometChat Dashboard:| Credential | Where to find it |
|---|---|
| App ID | Dashboard → Your App → Credentials |
| Auth Key | Dashboard → Your App → Credentials |
| Region | Dashboard → Your App → Credentials (e.g. us, eu, in) |
- Android Studio (Hedgehog or later recommended)
- An Android emulator or physical device running Android 9.0 (API 28) or higher
- Kotlin configured with Compose compiler plugin
- Gradle plugin 8.0+ with Kotlin DSL
Step 1 — Create an Android Project
- Open Android Studio and start a new project.
- Choose Empty Activity (Compose) as the project template.
- Set minimum API level to 28 or higher.
Step 2 — Install Dependencies
Add the CometChat Repository
Add the CometChat Maven repository to yoursettings.gradle.kts:
settings.gradle.kts
Add Dependencies
Open your app-levelbuild.gradle.kts and enable Compose, then add the dependencies:
build.gradle.kts
Step 3 — Initialize and Login
Create yourMainActivity.kt with the CometChat initialization and login flow. Since Compose uses a declarative approach, we track the auth state and render UI conditionally:
MainActivity.kt
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 Jetpack Compose
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