AI Integration Quick Reference
AI Integration Quick Reference
| Field | Value |
|---|---|
| Kotlin (XML Views) | com.cometchat:chat-uikit-kotlin v5.x |
| Jetpack Compose | com.cometchat:chat-uikit-compose v5.x |
| 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 |
| Theme | Set CometChatTheme.DayNight as parent theme in themes.xml |
| Calling | Optional. Add com.cometchat:calls-sdk-android to enable voice/video |
| Min SDK | Android 7.0 (API 24) |

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 7.0 (API 24) or higher
- Java 8 or higher
- Gradle plugin 4.0.1 or later
Step 1 — Create an Android Project
- Open Android Studio and start a new project.
- Choose Empty Activity as the project template.
- Enter a project name and choose Kotlin as the language.
- 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-levelsettings.gradle.kts file:
settings.gradle.kts
Add the CometChat Dependency
Choose the module that matches your UI toolkit:- Version Catalog (libs.versions.toml)
- Gradle (build.gradle.kts)
Inside Define the libraries — pick the module for your UI toolkit:Now, in your app-level
libs.versions.toml, add the versions:libs.versions.toml
- Kotlin (XML Views)
- Jetpack Compose
libs.versions.toml
build.gradle.kts file:build.gradle.kts
Add AndroidX Support
The Jetifier tool helps migrate legacy support libraries to AndroidX. Opengradle.properties and verify this line is present:
gradle.properties
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 ViewBindingJetpack Compose
Step-by-step integration using
chatuikit-jetpack with ComposablesBuild 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