🤖
Android
  • Chat SDK Android
  • Getting Started
    • Chat SDK Quickstart
    • Add the Chat SDK to a Firebase app
    • Add the Chat SDK to a non-Firebase app
  • Setup
    • Add Chat SDK to your project
    • Firebase Setup
    • Chat SDK Initialization
    • Set the Chat SDK Theme
    • Enable Location Messages
    • Authentication Screen
    • Add Additional Modules
    • Module Configuration
    • Proguard
  • API
    • Overriding Activities and Fragments
    • Events
    • Theming
    • Customizing the Icons
    • Tab Customization
    • Add a Chat Option
    • Message Customization
    • Integrating Chat SDK User profiles with your app
    • Overriding the Push Notification Handler
    • Handling Structured Meta Data
  • Chat SDK v4
    • Development Guide
    • Updating from v4 to v5
Powered by GitBook
On this page

Was this helpful?

  1. Setup

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:

For a working example check:

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]"
PreviousAdd the Chat SDK to a non-Firebase appNextFirebase Setup

Last updated 1 year ago

Was this helpful?

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