Create new project

For better performance, we highly recommend to use Android Studio.

Gradle setup

First, create new project (File - New - New Project) , then add the following lines into repositories section of your gradle file:

allprojects {
    repositories {
        jcenter()
        maven {
            url "http://dialog.bintray.com/android-sdk"
            credentials {
                username bintrayUser
                password bintrayPassword
            }
        }
    }
}

Note

Our SDK repository is private, so you need to obtain correct credentials for authorization from our developers.

You can specify them directly in the gradle file (albeit it is not recommended) or in the special file called gradle.properties in the root of your gradle project (create it if it does not exist):

bintrayUser Account name on bintray
bintrayPassword Api key
../../_images/gradle_properties.png

Having the repository set up, you should add these lines into the dependencies section of your gradle file:

compile "im.dlg:android-sdk:${dialogSdkVersion}"
compile "im.dlg:android-google-push:${dialogSdkVersion}"
compile "im.dlg:android-google-maps:${dialogSdkVersion}"

Use the actual version number instead of ${dialogSdkVersion}.

Set up Application class

Now, create application class in your source set directory (java/kotlin) and inherit it from DialogSDKApplication. This class class include MultiDex support and ConfigurationBuilder initialization (such as platform type, time zone, notification provider etc.). Don’t forget to add class in AndroidManifest.

Application.java example:

public class Application extends DialogSDKApplication {
        @Override
      public void onConfigureDialogSDK() {
            DialogSDK dialogSDK = DialogSDK.get();
            dialogSDK.setAppName("My Messenger");
            dialogSDK.setHomePage("http://mymessenger.im");
     }
}

Almost done!

For server and other flexible settings, such as app calls, pushes, delegates and more, please visit app configuration section .