Android
Introduction
If you are using a non-supported or a custom engine, we also provide the Antidote SDK library so you can directly access its validation and watermark methods.
Configuration
To integrate the SDK for Custom Engines in your project:
- Download the latest version of Antidote SDK for Custom Android Engines.
- Unzip the downloaded file and go to "custom engine" folder.
- You will find the
antidote.aarlibrary and headers. Include them to your project.
Validation
public static void validate(Context context, ValidationCallback validationCallback)
Example:
MyMainCode.java
import com.sekg.antidote.sdk.AntidoteSDK;
// on your main activity
public void onCreate (Bundle savedInstanceState) {
// ... your existing code
AntidoteSDK.validate(context, null);
}
Touches
public static void showTouches(Context context)
Example:
MyMainCode.java
import com.sekg.antidote.sdk.AntidoteSDK;
public MyView(Context context) {
super(context);
// ... your existing code
AntidoteSDK.showTouches(context);
}
Watermarks
note
Only ticker mode is currently supported. More modes will be added shortly!
public static void showTouches(Context context)
Example:
MyMainCode.java
import com.sekg.antidote.sdk.AntidoteSDK;
public MyView(Context context) {
super(context);
// ... your existing code
AntidoteSDK.showWatermark();
}
Events
public static void emitGameEvent(String action, String event)
Example:
MyMainCode.java
import com.sekg.antidote.sdk.AntidoteSDK;
public KillEnemy(Object enemy) {
// ... your existing code
AntidoteSDK.emitGameEvent("once", "killed_enemy");
}
All game events consist of an action and an event name, where action can be one of the following:
| Action | Description |
|---|---|
| start | mark the start of a long-running event (e.g. boss_battle) |
| end | mark the end of a long-running event (e.g. boss_battle) |
| once | emit a once-off event (e.g. collected_powerup) |
User Information
To access the Antidote User ID of the user opening the game, you can use the following function:
AntidoteSDK.getUserId()
The returned string is the user ID.