> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-rn-guide-message-privately.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Call

> Add one-on-one and group audio/video calling to your Android app using the CometChat Calls SDK and UI Kit.

<Accordion title="AI Integration Quick Reference">
  | Field          | Value                                                                                                                                                                                                                                                                                   |
  | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Package        | `com.cometchat:chat-uikit-android` + `com.cometchat:calls-sdk-android` (`implementation 'com.cometchat:calls-sdk-android:4.+.+'`)                                                                                                                                                       |
  | Required setup | `CometChatUIKit.init()` then `CometChatUIKit.login()` — Calls SDK must also be installed                                                                                                                                                                                                |
  | Call features  | Incoming Call, Outgoing Call, Call Logs, Call Buttons                                                                                                                                                                                                                                   |
  | Key components | `CometChatCallButtons` → [Call Buttons](/ui-kit/android/call-buttons), `CometChatIncomingCall` → [Incoming Call](/ui-kit/android/incoming-call), `CometChatOutgoingCall` → [Outgoing Call](/ui-kit/android/outgoing-call), `CometChatCallLogs` → [Call Logs](/ui-kit/android/call-logs) |
  | Auto-detection | UI Kit automatically detects the Calls SDK and enables call UI components                                                                                                                                                                                                               |
  | Related        | [Getting Started](/ui-kit/android/getting-started), [Core Features](/ui-kit/android/core-features), [Call Log Details Guide](/ui-kit/android/guide-call-log-details)                                                                                                                    |
</Accordion>

CometChat's Calls feature is an advanced functionality that allows you to seamlessly integrate one-on-one as well as group audio and video calling capabilities into your application. This document provides a technical overview of these features, as implemented in the Android UI Kit.

## Integration

First, make sure that you've correctly integrated the UI Kit library into your project. If you haven't done this yet or are facing difficulties, refer to our [Getting Started](/ui-kit/android/getting-started) guide. This guide will walk you through a step-by-step process of integrating our UI Kit into your Android project.

Once you've successfully integrated the UI Kit, the next step is to add the CometChat Calls SDK to your project. This is necessary to enable the calling features in the UI Kit.

### Step 1: Add Calls SDK Dependency

Add the following dependency to your `build.gradle` file:

```gradle lines theme={null}
dependencies {
  implementation 'com.cometchat:calls-sdk-android:4.+.+'
}
```

After adding this dependency, sync your project. The Android UI Kit will automatically detect the Calls SDK and activate the calling features.

### Step 2: Verify Call Buttons Appear

Once the Calls SDK is integrated, you will see the [CallButtons](/ui-kit/android/call-buttons) component automatically rendered in the [MessageHeader](/ui-kit/android/message-header) component. This provides users with quick access to initiate audio and video calls.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/Gp90C5sdVtuRR4t7/images/81959c4b-Calling-ee689247c8cdd512c520b85f30683ad8.png?fit=max&auto=format&n=Gp90C5sdVtuRR4t7&q=85&s=670936936a9978d89c39d3820707d3ae" width="1440" height="833" data-path="images/81959c4b-Calling-ee689247c8cdd512c520b85f30683ad8.png" />
</Frame>

### Step 3: Add Call Listener for Incoming Calls

To receive incoming calls globally in your app, you will need to add a `CallListener`. This should be added before you initialize the CometChat UI Kit. We recommend creating a custom Application class and adding the call listener there.

When an incoming call is received, you can display the `CometChatIncomingCall` component using the current activity context.

<Tabs>
  <Tab title="Kotlin">
    ```kotlin lines theme={null}
    class BaseApplication : Application() {

        companion object {
            private val LISTENER_ID = "${BaseApplication::class.java.simpleName}${System.currentTimeMillis()}"
        }

        override fun onCreate() {
            super.onCreate()

            CometChat.addCallListener(LISTENER_ID, object : CometChat.CallListener {
                override fun onIncomingCallReceived(call: Call) {
                    // Get the current activity context
                    val currentActivity = getCurrentActivity() // Implement this method
                    
                    currentActivity?.let {
                        // Create and display the incoming call component
                        val incomingCallView = CometChatIncomingCall(it)
                        incomingCallView.call = call
                        incomingCallView.fitsSystemWindows = true
                        incomingCallView.onError = OnError { exception ->
                            // Handle errors
                        }
                        
                        // Display the component (e.g., as dialog or snackbar)
                    }
                }

                override fun onOutgoingCallAccepted(call: Call) {
                    // Handle outgoing call acceptance
                }

                override fun onOutgoingCallRejected(call: Call) {
                    // Handle outgoing call rejection
                }

                override fun onIncomingCallCancelled(call: Call) {
                    // Handle incoming call cancellation
                }
            })
        }
    }
    ```
  </Tab>

  <Tab title="Java">
    ```java lines theme={null}
    public class BaseApplication extends Application {

        private static final String LISTENER_ID = BaseApplication.class.getSimpleName() + System.currentTimeMillis();

        @Override
        public void onCreate() {
            super.onCreate();
            
            CometChat.addCallListener(LISTENER_ID, new CometChat.CallListener() {
                @Override
                public void onIncomingCallReceived(Call call) {
                    // Get the current activity context
                    Activity currentActivity = getCurrentActivity(); // Implement this method
                    
                    if (currentActivity != null) {
                        // Create and display the incoming call component
                        CometChatIncomingCall incomingCallView = new CometChatIncomingCall(currentActivity);
                        incomingCallView.setCall(call);
                        incomingCallView.setFitsSystemWindows(true);
                        
                        // Display the component (e.g., as dialog or snackbar)
                    }
                }

                @Override
                public void onOutgoingCallAccepted(Call call) {
                    // Handle outgoing call acceptance
                }

                @Override
                public void onOutgoingCallRejected(Call call) {
                    // Handle outgoing call rejection
                }

                @Override
                public void onIncomingCallCancelled(Call call) {
                    // Handle incoming call cancellation
                }
            });
        }
    }
    ```
  </Tab>
</Tabs>

## Call Components

The CometChat Android UI Kit provides four main components for implementing calling features in your app. Each component handles a specific part of the calling experience.

### Call Buttons

The [Call Buttons](/ui-kit/android/call-buttons) component provides users with quick access to initiate audio and video calls. This component is automatically rendered in the [MessageHeader](/ui-kit/android/message-header) when the Calls SDK is integrated.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/Xgdtn9VZPDi47bm-/images/2338801e-call_button-90161ce159058183ff0d16adbf8f4734.png?fit=max&auto=format&n=Xgdtn9VZPDi47bm-&q=85&s=abd43b4d7f4d8dc7772cf21aaf99307a" width="2560" height="464" data-path="images/2338801e-call_button-90161ce159058183ff0d16adbf8f4734.png" />
</Frame>

[Learn more about Call Buttons →](/ui-kit/android/call-buttons)

### Incoming Call

The [Incoming Call](/ui-kit/android/incoming-call) component displays when a user receives an incoming call. It provides a full-screen interface showing caller information and call controls.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/2SVOPiSpm0QEqRoz/images/ef9ae7b8-Incoming_call-060686ee2b9aa89ad7c163fc8290d390.png?fit=max&auto=format&n=2SVOPiSpm0QEqRoz&q=85&s=c987baad17611dbd80d128b895bda2ad" width="360" height="720" data-path="images/ef9ae7b8-Incoming_call-060686ee2b9aa89ad7c163fc8290d390.png" />
</Frame>

[Learn more about Incoming Call →](/ui-kit/android/incoming-call)

### Outgoing Call

The [Outgoing Call](/ui-kit/android/outgoing-call) component manages the outgoing call experience. It displays while waiting for the recipient to answer and automatically transitions to the active call screen once accepted.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/2JiXkJ8lq6PmPGlJ/images/703120eb-outgoing_call-c24eb1936c04bb40ea873ac19b973b56.png?fit=max&auto=format&n=2JiXkJ8lq6PmPGlJ&q=85&s=fc41a9e26489f6706d5933679236d06b" width="1440" height="833" data-path="images/703120eb-outgoing_call-c24eb1936c04bb40ea873ac19b973b56.png" />
</Frame>

[Learn more about Outgoing Call →](/ui-kit/android/outgoing-call)

### Call Logs

The [Call Logs](/ui-kit/android/call-logs) component displays a history of all call activities, including missed, received, and dialed calls. Users can view call details and initiate new calls from the log.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/Gp90C5sdVtuRR4t7/images/7fe2a6db-call_logs-7b4f502153923374898f3887441ab8d2.png?fit=max&auto=format&n=Gp90C5sdVtuRR4t7&q=85&s=14435b9084f986487b17304c759a86a2" width="1280" height="800" data-path="images/7fe2a6db-call_logs-7b4f502153923374898f3887441ab8d2.png" />
</Frame>

[Learn more about Call Logs →](/ui-kit/android/call-logs)

### Call Log Details

For detailed information about individual calls, including participants, join/leave history, and recordings, see the [Call Log Details](/ui-kit/android/guide-call-log-details) guide.
