# Installation

INFO

SDK supports platform versions from Android 4.4 (API 19) to Android 12 (API 32). Checkout more on Distribution dashboard. (opens new window)

Step 1. Import SDK

To import our library add https://android-sdk.user.com repository to project’s build.gradle file:

allprojects {
    repositories {
        …
        maven {
            url 'https://android-sdk.user.com'
        }
    }
}

and com.user:android-sdk:1.2.2 dependence to you app’s build.gradle file

dependencies {
    implementation 'com.user:android-sdk:1.2.2'
}

Step 2. Configure SDK in your app updated in 1.2.2

In your Application root file initialize UserCom.Builder with your SDK API key, context and base URL. It will initialize UserCom instance. You can generate API key in User.com web panel. It was described in getting started section If you want to track you client’s mobile view screens activities you also can append .trackAllActivities(true) like on the sample code below:

public class App extends Application {

    public static final String TAG = App.class.getSimpleName();

    @Override
    public void onCreate() {
        super.onCreate();

        new UserCom.Builder(
            this,
            "mobile_sdk_key", //your mobile sdk key generated in User.com webpanel details
            "integrations_api_key", // your api secret key from User.com webpanel under Settings -> Setup & Integration
            "https://<your_app_subdomain>.user.com"
        )
                .trackAllActivities(true)  // false by default
                .openLinksInChromeCustomTabs(true) // true by default
                .setCustomTabsBuilder(getCustomTabsBuilder())
                .build();
    }

    private static CustomTabsIntent.Builder getCustomTabsBuilder() {
        CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
        builder.setToolbarColor(Color.GREEN);
        return builder;
    }
}