Chat SDK Initialization

Setup main application subclass

The best place to initialize the Chat SDK is in the onCreate method of your Application subclass.

If you don't already have this class, create it:

public class MainApp extends Application {

    public void onCreate() {

        // Chat SDK intialization goes here


Register this class in your AndroidManifest.xml:

<application android:name=".MainApp">

Note: Sometimes people confuse the onCreate method in the main activity with the onCreate method from the Activity class. Although in some cases it is possible to setup the Chat SDK from inside an activity, it is not recommended.

Configure Chat SDK

Chat SDK offers two ways to configure the library - quick config and advanced. Quick allows you get the project up and running with a standard configuration.

Quick Start







Pro Modules

If you want to use the licensed modules you will need to provide an identifier. That can be your Patreon ID, your Github Sponsors username, or the email address you used to buy the license at

Quick Start

You can use:



ChatSDK.builder() .... .build().activateWithPatreon(...)
ChatSDK.builder() .... .build().activateWithGithubSponsors(...)
ChatSDK.builder() .... .build().activateWithEmail(...)

Advanced Configuration

Builder pattern

The Chat SDK and its modules use the builder pattern for configuration. You will always call builder() then set your configuration then call build() to finish.


The Chat SDK contains a number of optional modules. These can be added with the addModule method. At the very minimum, you should activate the UIModule and one of FirebaseModule, XMPPModule or FireStreamModule.

Full example

Here is a default configuration.

try {
            .setGoogleMaps("Your Google Static Maps API key")

            // Add the Firebase network adapter module

            // Add the UI module

            // Add modules to handle file uploads, push notifications

            // Enable Firebase UI with phone and email auth
                    .setProviders(EmailAuthProvider.PROVIDER_ID, PhoneAuthProvider.PROVIDER_ID)

            // Activate
} catch (Exception e) {

Configuration options

The Chat SDK has many configuration options. Too many to list here. The best way to see what's available is by using auto-complete in Android Studio. After press (control + enter) and the list of available options will appear. You can also (cmd + click) to inspect the Config class and see a full list of the available options.

Last updated