> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup

> CometChat Calling SDK v5 - Setup for Android

<Info>
  **Faster Integration with UI Kits**

  If you're using CometChat UI Kits, voice and video calling can be quickly integrated:

  * Incoming & outgoing call screens
  * Call buttons with one-tap calling
  * Call logs with history

  👉 [Android UI Kit Calling Integration](/ui-kit/android/calling-integration)

  Use this Calls SDK directly only if you need custom call UI or advanced control.
</Info>

This guide walks you through installing the CometChat Calls SDK and initializing it in your Android application.

## Add the CometChat Dependency

### Step 1: Add Repository

Add the CometChat repository URL to your **project level** `build.gradle` file in the `repositories` block:

<Tabs>
  <Tab title="Groovy">
    ```groovy theme={null}
    allprojects {
      repositories {
        maven {
          url "https://dl.cloudsmith.io/public/cometchat/cometchat/maven/"
        }
      }
    }
    ```
  </Tab>

  <Tab title="Kotlin DSL">
    ```kotlin theme={null}
    allprojects {
      repositories {
        maven {
          url = uri("https://dl.cloudsmith.io/public/cometchat/cometchat/maven/")
        }
      }
    }
    ```
  </Tab>
</Tabs>

### Step 2: Add Dependencies

Add the Calls SDK dependency to your **app level** `build.gradle` file:

<Tabs>
  <Tab title="Groovy">
    ```groovy theme={null}
    dependencies {
      implementation "com.cometchat:calls-sdk-android:5.0.0"
    }
    ```
  </Tab>

  <Tab title="Kotlin DSL">
    ```kotlin theme={null}
    dependencies {
      implementation("com.cometchat:calls-sdk-android:5.0.0")
    }
    ```
  </Tab>
</Tabs>

### Step 3: Configure Java Version

Add Java 8 compatibility to the `android` section of your **app level** `build.gradle`:

<Tabs>
  <Tab title="Groovy">
    ```groovy theme={null}
    android {
      compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
      }
    }
    ```
  </Tab>

  <Tab title="Kotlin DSL">
    ```kotlin theme={null}
    android {
      compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
      }
    }
    ```
  </Tab>
</Tabs>

## Add Permissions

Add the required permissions to your `AndroidManifest.xml`:

```xml theme={null}
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
```

<Note>
  For Android 6.0 (API level 23) and above, you must request camera and microphone permissions at runtime before starting a call.
</Note>

## Initialize CometChat Calls

The `init()` method initializes the SDK with your app credentials. Call this method once when your application starts, typically in your `Application` class or main `Activity`.

### CallAppSettings

The `CallAppSettings` class configures the SDK initialization:

| Parameter | Type   | Required | Description                    |
| --------- | ------ | -------- | ------------------------------ |
| `appId`   | String | Yes      | Your CometChat App ID          |
| `region`  | String | Yes      | Your app region (`us` or `eu`) |

<Tabs>
  <Tab title="Kotlin">
    ```kotlin theme={null}
    import com.cometchat.calls.core.CometChatCalls
    import com.cometchat.calls.core.CallAppSettings

    val appId = "APP_ID" // Replace with your App ID
    val region = "REGION" // Replace with your Region ("us" or "eu")

    val callAppSettings = CallAppSettings.CallAppSettingBuilder(appId, region).build()

    CometChatCalls.init(this, callAppSettings, object : CometChatCalls.CallbackListener<String>() {
        override fun onSuccess(message: String) {
            Log.d(TAG, "CometChat Calls SDK initialized successfully")
        }

        override fun onError(e: CometChatException) {
            Log.e(TAG, "CometChat Calls SDK initialization failed: ${e.message}")
        }
    })
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    import com.cometchat.calls.core.CometChatCalls;
    import com.cometchat.calls.core.CallAppSettings;

    String appId = "APP_ID"; // Replace with your App ID
    String region = "REGION"; // Replace with your Region ("us" or "eu")

    CallAppSettings callAppSettings = new CallAppSettings.CallAppSettingBuilder(appId, region).build();

    CometChatCalls.init(this, callAppSettings, new CometChatCalls.CallbackListener<String>() {
        @Override
        public void onSuccess(String message) {
            Log.d(TAG, "CometChat Calls SDK initialized successfully");
        }

        @Override
        public void onError(CometChatException e) {
            Log.e(TAG, "CometChat Calls SDK initialization failed: " + e.getMessage());
        }
    });
    ```
  </Tab>
</Tabs>

| Parameter         | Description                                       |
| ----------------- | ------------------------------------------------- |
| `this`            | Android context (Application or Activity context) |
| `callAppSettings` | Configuration object with App ID and Region       |
| `listener`        | Callback listener for success/error handling      |

## Check Initialization Status

You can verify if the SDK has been initialized using the `isInitialized()` method:

<Tabs>
  <Tab title="Kotlin">
    ```kotlin theme={null}
    if (CometChatCalls.isInitialized()) {
        // SDK is ready to use
    } else {
        // Initialize the SDK first
    }
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    if (CometChatCalls.isInitialized()) {
        // SDK is ready to use
    } else {
        // Initialize the SDK first
    }
    ```
  </Tab>
</Tabs>
