AI Integration Quick Reference
AI Integration Quick Reference
| Field | Value |
|---|---|
| Package | com.cometchat:chat-uikit-kotlin |
| UI Layer | Kotlin + XML Views (View Binding) |
| 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 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
Step 1 — Create an Android Project
- Open Android Studio and start a new project.
- Choose Empty Activity as the project template.
- Select Kotlin as the language.
- 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 View Binding, then add the dependencies:
build.gradle.kts
Add AndroidX Support
Verify this line is present ingradle.properties:
gradle.properties
Step 3 — Initialize and Login
Create yourMainActivity.kt with the CometChat initialization and login flow:
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 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