Skip to main content

Overview

SDK Version Selection

Choose your SDK version below:

  • Apptrove SDK → Recommended for all projects (Latest: v2.0.0)
  • Trackier SDK → Will be deprecated in May 2026 (v1.x.xx)

Use the tabs below to view installation instructions for your chosen SDK.

This guide provides step-by-step instructions to install the SDK into your Android application using Gradle. It covers adding dependencies, configuring permissions, and setting up support for Google Play, Xiaomi GetApps, and Google Advertising ID.


Installing the SDK

Package: com.apptrove:android-sdk:2.0.0

Install the Android SDK using Gradle.

Step 1: Declare the Maven Central Repository

In your Project-level build.gradle file, add the mavenCentral() repository:

repositories {
mavenCentral()
}

Step 2: Add the SDK Dependency

In your Module-level build.gradle file, include the Apptrove SDK dependency:

dependencies {
implementation 'com.apptrove:android-sdk:2.0.0'
}
note

Latest Version: 2.0.0
Check Maven Repository for updates.


Configure Required Permissions

To enable the SDK to access device information and network features, declare the required permissions in your AndroidManifest.xml file. Add the following permissions inside the <manifest> tag:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package=YOUR_PACKAGE_NAME>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<!-- Optional: Required for certain device information -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

...

</manifest>
note

The READ_PHONE_STATE permission is optional and should only be included if your app requires access to specific device information.


Google Advertising ID (GAID) Configuration

To comply with Google Play Store requirements, use the Google Advertising ID (gps_adid) for device identification.

Step 1: Add the Google Play Services Ads Identifier Dependency

In your Module-level build.gradle file, add the following dependency:

dependencies {
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
}
note

Please use the latest stable version of com.google.android.gms:play-services-ads-identifier dependency.

Step 2: Add AD_ID Permission (Android 12+)

For apps targeting Android 12 or higher, include the AD_ID permission in your AndroidManifest.xml:

<uses-permission android:name="com.google.android.gms.permission.AD_ID" />

Step 3: Include Google Play Services Version Meta-Data

Add the following meta-data inside the <application> tag in your AndroidManifest.xml:

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

Adding Store Referrer Libraries

The SDK supports multiple store referrer libraries to enhance attribution accuracy. Simply add the required referrer dependency—everything else is handled automatically by the SDK.

Option 1: Google Play Install Referrer

To support attribution via the Google Play Store, integrate the Google Play Install Referrer API.

In your Module-level build.gradle file, add the following dependency:

dependencies {
implementation 'com.android.installreferrer:installreferrer:2.2'
}
note

Please use the latest stable version of com.android.installreferrer:installreferrer dependency.

Option 2: Xiaomi GetApps Store Referrer

For apps targeting the Xiaomi GetApps Store, include the Xiaomi referrer dependency in your Module-level build.gradle file:

dependencies {
implementation 'com.miui.referrer:homereferrer:1.0.0.6'
}
note

Please use the latest stable version of com.miui.referrer:homereferrer dependency.


ProGuard Configuration

If your app uses ProGuard for code optimization, add the following rules to your ProGuard configuration file (e.g., proguard-rules.pro) to prevent the removal of required classes:

-keep class com.apptrove.sdk.** { *; }
-keep class com.google.android.gms.common.ConnectionResult {
int SUCCESS;
}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {
com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context);
}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info {
java.lang.String getId();
boolean isLimitAdTrackingEnabled();
}
-keep public class com.android.installreferrer.** { *; }
-keep class kotlin.Metadata { *; }
-keep class kotlin.reflect.jvm.internal.** { *; }
-keep class kotlin.** { *; }
-dontwarn kotlin.**