Android
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.gradlefile at theProjectlevel
buildscript {
repositories {
jcenter()
mavenCentral()
}
}
- Add the dependency to the
build.gradlefile in themoduledirectory:
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 name | Description | Version requirement |
|---|---|---|
| TDAnalytics | Collects and processes data | >= 3.1.0 |
| TDRemoteConfig | Fetches configuration from the AE backend | >= 1.0.0 |
| TDCore | Provides basic components | >= 1.1.0 |
| TDStrategy | Provides client-side triggering | >=1.0.0 |
- Click the download link at the top of this page to download the SDK, and then unzip it
- Add
TDAnalytics.aar,TDCore.aar,TDRemoteConfig.aar, andTDStrategy.aarto the libs folder - 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 name | Type | Description |
|---|---|---|
| channelMsgType | String | Channel message type |
| appId | String | The app id of your AE project |
| pushId | String | Channel send ID of the operation task |
| taskId | String | ID of the operation task |
| content | JSONObject | Push content of the operation task |
| userParams | JSONObject | Custom parameters in the client channel |
| opsProperties | JSONObject | Channel information carried by the client-triggered task, used as receipt parameters for touch funnel events. |

