Skip to main content

Android

Last updated 10/03/2026
tip

The Android SDK requires Android 4.0 (API 14) or later.

Latest version: v1.4.1

Update time: 2026-05-12

Downloads: Download

1. Overview​

Starting from AE 4.4, the Engage module provides the client-triggered task feature, which supports millisecond-level triggering in in-app scenarios such as new user registration and character creation, as well as real-time A/B splitting. On the client side, the ThinkingData SDK communicates with the AE backend to fetch and evaluate tasks.

Integrate the ThinkingData SDK into your app. On the app side, you only need to handle interactions with the ThinkingData SDK and don't need to care about task details in the AE backend.

2. Integration​

2.1 Integrate the SDK automatically​

  • Add the following dependency configuration to the build.gradle file at the Project level
buildscript {
repositories {
jcenter()
mavenCentral()
}
}
  • Add the dependency to the build.gradle file in the module directory:
dependencies {
implementation 'cn.thinkingdata.android:TDStrategy:1.4.1'
}

2.2 Integrate the ThinkingData SDK manually​

Client-triggered tasks depend on the following ThinkingData SDKs:

SDK nameDescriptionVersion requirement
TDAnalyticsCollects and processes data>= 3.1.0
TDRemoteConfigFetches configuration from the AE backend>= 1.0.0
TDCoreProvides basic components>= 1.1.0
TDStrategyProvides client-side triggering>=1.0.0
  1. Click the download link at the top of this page to download the SDK, and then unzip it
  2. Add TDAnalytics.aar, TDCore.aar, TDRemoteConfig.aar, and TDStrategy.aar to the libs folder
  3. Add the following configuration to build.gradle
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar','*.aar'])
}

3. Initialization​

Initialize the SDK

import cn.thinkingdata.core.TDApp;
import cn.thinkingdata.core.TDSettings;
// For details on how to configure TDSettings, see [Advanced guide]
TDSettings settings = new TDSettings();
settings.appId = "AppId";
settings.serverUrl = "ServerUrl";
TDApp.init(this,settings);

4. Set a callback listener​

After the SDK is initialized, set a callback listener for the TDStrategy SDK.

import cn.thinkingdata.strategy.TDStrategy;
import cn.thinkingdata.strategy.core.result.TDStrategyResult;
import cn.thinkingdata.strategy.core.result.TDStrategyResultListener;

TDStrategy.setTriggerListener(new TDStrategyResultListener() {
@Override
public void onTriggerResult(TDStrategyResult tdStrategyResult) {

}
});

4.1 Callback data model​

public class TDStrategyResult {
public String appId;
public String taskId;
public String channelMsgType;
public String pushId;
public JSONObject content;
public JSONObject userParams;
public JSONObject opsProperties;
}

Property description

Property nameTypeDescription
channelMsgTypeStringChannel message type
appIdStringThe app id of your AE project
pushIdStringChannel send ID of the operation task
taskIdStringID of the operation task
contentJSONObjectPush content of the operation task
userParamsJSONObjectCustom parameters in the client channel
opsPropertiesJSONObjectChannel information carried by the client-triggered task, used as receipt parameters for touch funnel events.
Was this page helpful?