Home
/
Chat
/
Android

Install and configure the Chat SDK

This page provides a step-by-step guide that demonstrates how to build and configure an in-app chat using Sendbird Chat SDK. Sendbird Chat SDK can be installed through Gradle.


Step 1: Create a Sendbird application from your dashboard

A Sendbird application comprises everything required in a chat service including users, message, and channels. To create an application:

  1. Go to the Sendbird Dashboard and enter your email and password, and create a new account. You can also sign up with a Google account.
  2. When prompted by the setup wizard, enter your organization information to manage Sendbird applications.
  3. Lastly, when your dashboard home appears after completing setup, click Create + at the top-right corner.

Only one Sendbird application can be integrated per app for your service regardless of the platform. All users within your Sendbird application can communicate with each other across all platforms. This means that your iOS, Android, and web client app users can all send and receive messages with one another without any further setup.

Note: All data is limited to the scope of a single application, and users in different Sendbird applications can't chat with each other.


Step 2: Install the Chat SDK

Installing the Chat SDK is simple if you're familiar with using external libraries or SDKs. First, add the following code to your root build.gradle file:

build.gradle
Light Color Skin
Copy
allprojects {
    repositories {
        ...
        maven { url "https://repo.sendbird.com/public/maven" }
    }
}

Note: Make sure the above code block isn't added to your module bundle.gradle file.

Then, add the dependency to your module build.gradle file:

build.gradle
Light Color Skin
Copy
dependencies {
    ...
    implementation 'com.sendbird.sdk:sendbird-android-sdk:3.0.168'
    ...
}

Note: Chat SDK versions 3.0.160 or lower can be downloaded from JCenter until February 1, 2022. SDK versions higher than 3.0.160 will be available on Sendbird's remote repository.

Alternatively, you can download the .aar file from the link below. Copy this file into your libs/ folder, and make sure you include the library in your build.gradle file as well.

Download latest SDK


Step 3: Grant system permissions to the Chat SDK

The Chat SDK requires system permissions. These permissions allow the Chat SDK to communicate with Sendbird server and read from and write on a user device’s storage. To grant system permissions, add the following lines to your AndroidManifest.xml file.

AndroidManifest.xml
Light Color Skin
Copy
<uses-permission android:name="android.permission.INTERNET" />

<!-- READ/WRITE_EXTERNAL_STORAGE permissions are required to upload or download files from/into external storage. -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

(Optional) Step 4: Configure ProGuard to shrink code and resources

When you build your APK with minifyEnabled true, add the following line to the module's ProGuard rules file.

Light Color Skin
Copy
-dontwarn com.sendbird.android.shadow.**