Skip to main content
FieldValue
Packagecom.cometchat:chat-uikit-android
ComponentsCometChatConversations, CometChatCallLogs, CometChatUsers, CometChatGroups, CometChatMessageHeader, CometChatMessageList, CometChatMessageComposer
LayoutTabbed bottom navigation (Chats, Calls, Users, Groups) + fragment container
PrerequisiteComplete Integration Steps 1–4 first
PatternFull-featured messaging app with multiple sections
This guide builds a tabbed messaging UI — Chats, Calls, Users, and Groups tabs via BottomNavigationView, with each tab loading its CometChat component in a fragment container. This assumes you’ve already completed Integration (project created, dependencies installed, init + login working, theme set up).

What You’re Building

Three sections working together:
  1. Bottom navigation bar — switches between Chats, Calls, Users, and Groups
  2. Fragment container — renders the CometChat component for the active tab
  3. Dynamic content — each tab loads its respective Fragment with real-time data
This uses Android’s BottomNavigationView pattern: TabbedActivity hosts the navigation and fragment container, user taps a tab, the corresponding Fragment loads.

Step 1: Set Up Tabbed Activity

Create a new Activity called TabbedActivity with BottomNavigationView to manage tab navigation.

Project Structure

Create the following files in your Android project:

Vector Drawable Icons

Download the navigation icons from the CometChat UI Kit repository: 🔗 GitHub Drawable Resources Place the icon files (ic_chats.xml, ic_calls.xml, ic_user.xml, ic_group.xml) in your res/drawable/ directory.

Implementation

TabbedActivity.kt
You must use an activity that supports the lifecycle API, such as:
  • AppCompatActivity
  • ComponentActivity
  • FragmentActivity
This is necessary to properly manage the UI Kit’s lifecycle events.

Step 2: Create Fragments for Each Tab

Each tab displays a different CometChat UI component wrapped in a Fragment.

Chats Fragment

ChatsFragment.kt

Call Logs Fragment

Make sure you’ve added the Calls SDK dependency to enable voice and video calling features.
CallLogsFragment.kt

Users Fragment

UsersFragment.kt

Groups Fragment

GroupsFragment.kt

Step 3: Launch TabbedActivity from Your App

Update your MainActivity to launch TabbedActivity after successful login:
MainActivity.kt

Running the Application

Once you’ve completed the setup, build and run your Android application:
Required PermissionsEnsure you’ve added the necessary permissions in your AndroidManifest.xmland initialized CometChat in your Application class:
For Call Features, also add:

Next Steps

Components Overview

Explore all available UI Kit components and their customization options

Theming

Customize colors, fonts, and styles to match your brand

Integration

Back to the main setup guide

Feature Guides

Add capabilities like threaded messages, blocking, and group management