# Add Chat SDK to your project

#### Android X

Make sure you've added the following to your `gradle.properties` file:

```
android.useAndroidX=true
android.enableJetifier=true
```

#### Inherit from Chat SDK theme

The Chat SDK uses custom attributes so you need to make sure that your app inherits from the Chat SDK theme.

```
<style name="AppTheme" parent="ChatSDKTheme">
```

#### Add Gradle dependencies

**Project-level build.gradle**

```
buildscript {
    dependencies {
        classpath "com.google.gms:google-services:4.3.10"
        ...
    }
    ...
}

allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}
```

**App-level build.gradle**

Enable multi-dex, Java 8 and the Google Services plugin:

```
apply plugin: 'com.google.gms.google-services'

android {

    defaultConfig {
        multiDexEnabled = true
        ...
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
```

Then add the dependencies. Replace the `[latest-version]` with the numerical part of:

![](https://img.shields.io/maven-central/v/chat.sdk/core)

For a working example check:&#x20;

<https://github.com/chat-sdk/chat-sdk-android-example>

Choose **one** of the following backends to use:

**Firebase**

```
implementation "chat.sdk:firebase-app:[latest-version]"
```

**FireStream (beta)**

```
implementation "chat.sdk:firestream-app:[latest-version]"
```

**XMPP**

```
implementation "chat.sdk:xmpp-app:[latest-version]"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://chat-sdk.gitbook.io/android/setup/add-chat-sdk-to-your-project.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
