AI Integration Quick Reference
AI Integration Quick Reference
| Field | Value |
|---|---|
| Packages | com.cometchat:chatuikit-kotlin · com.cometchat:chatuikit-jetpack |
| Key components | CometChatCallLogs, CometChatCallLogDetails, CallDetailsActivity, CallDetailsViewModel |
| Purpose | Build a call log details screen showing metadata, participants, join/leave history, and recordings. |
| Related | Call Logs, Call Buttons, All Guides |
Overview
When a user taps a call entry, the Call Details screen shows:- Metadata: Call type, duration, timestamp, and status.
- Participants: List of users who joined the call.
- History: Chronological join/leave events.
- Recordings: Playback links for any recorded calls.
Prerequisites
- Android Studio project targeting API 24+.
- CometChat Android UI Kit v5 (
com.cometchat:chatuikit-kotlinorcom.cometchat:chatuikit-jetpack) and CometChat Calls SDK added inbuild.gradle. - A logged-in CometChat user (
CometChat.getLoggedInUser()non-null). - Required permissions in
AndroidManifest.xml: Internet, Camera, Microphone. - ViewBinding enabled or equivalent view setup.
Components
| Component / Class | Role |
|---|---|
CallsFragment | Displays the list of recent calls using CometChatCallLogs component. |
HomeActivity | Hosts bottom navigation; loads CallsFragment for the Calls tab. |
CallDetailsActivity | Container for the call details UI with tab navigation. |
CallDetailsTabFragmentAdapter | Adapter for ViewPager2 managing detail tabs. |
CometChatCallLogDetails | UI Kit widget that renders metadata, participants, history, and recordings. |
CallDetailsViewModel | ViewModel fetching call data and exposing it via StateFlow. |
Integration Steps
1. Show Call Logs Using CometChatCallLogs
Use the UI Kit’s CometChatCallLogs component to display recent calls.
- Kotlin (XML Views)
- Jetpack Compose
fragment_calls.xml
CallsFragment.kt
2. Load CallsFragment in HomeActivity
Display the Calls tab via bottom navigation.
- Kotlin (XML Views)
- Jetpack Compose
HomeActivity.kt
3. Configure CallDetailsActivity
Initialize the detail screen with tabs for metadata, participants, history, and recordings.
- Kotlin (XML Views)
- Jetpack Compose
CallDetailsActivity.kt
4. Implement CometChatCallLogDetails Component
Use the UI Kit widget for an all-in-one detail view.
- Kotlin (XML Views)
- Jetpack Compose
Implementation Flow
- CallsFragment fetches and displays call logs list.
- User taps a call → navigates to CallDetailsActivity / CallDetailsScreen with call data.
- Detail screen initializes ViewModel, ViewPager2/TabRow, and TabLayout.
- Tab fragments/composables render participants, join/leave history, and recordings.
- CometChatCallLogDetails can be used as a single-widget alternative.
Customization Options
- Style tabs and headers via
CometChatThemeor custom attributes. - Override individual fragments/composables for additional data (e.g., call notes).
- Control visibility of tabs based on call type or recording availability.
Filtering & Edge Cases
- Missed Calls: Use
CallsRequestBuilder().setTypes(CallType.MISSED)to filter. - No Recordings: Hide or disable the Recordings tab.
- Blocked Users: Disable profile links in Participants tab.
Error Handling
- Observe
StateFlow<Throwable>inCallDetailsViewModelto show retry UIs. - Use
detailsView.setOnError()andsetOnEmpty()for fallback views in UI Kit widget.
Summary / Feature Matrix
| Feature | Component / Method |
|---|---|
| Display call logs list | CometChatCallLogs in CallsFragment |
| Navigate to detail screen | Intent / Compose navigation + CallDetailsActivity |
| Render detail tabs | CallDetailsTabFragmentAdapter / Compose TabRow |
| Single-widget detail view | CometChatCallLogDetails |
| Theming & styling | CometChatTheme, custom styles |
| Error & empty-state handling | setOnError(), setOnEmpty() |
Android Sample App (Kotlin)
Explore this feature in the CometChat SampleApp:
GitHub → SampleApp