Getting Started

Unlock the power of data insights and elevate user engagement with seamless integration of the Antsomi Android SDK

1. Installation

The easiest way to use Antsomi SDK in your Android project is with Maven. Antsomi Android SDK is hosted on mavenCentral Maven repository.

Add dependencies of Antsomi in the app/build.gradle file.

dependencies {
  implementation 'com.antsomi:antsomi:1.+'
}

Important

Antsomi SDK only supports Android SDK 16 and above.

2. Initialization

Step 1: Import Antsomi packages in your Application class.

import com.antsomi.AntsomiSdk;

Step 2: Initialize Antsomi SDK

From onCreate callback of your Application class, initialize Antsomi SDK instance as shown below

import android.app.Application;

import com.antsomi.AntsomiSdk;

public class ApplicationClass extends Application {
    // ... other fields and methods

    @Override
    protected void onCreate() {
        super.onCreate();
        
        // Init Antsomi SDK instance
        try {
            String portalId = "564890637";
            String sourceId = "564993464";
            String appId = "e4e8d06e-4d97-43df-93e8-c36238147ca0";
    
            new AntsomiSdk.Builder(this, portalId, sourceId, appId).build();
        } catch (Exception e) {
            Log.e(TAG, e.getMessage(), e);
        }
    }
}

In which:

KeyDescriptionExample

portalId

Your CDP365 Portal ID.

564890637

sourceId

Your CDP365 Event Source ID.

564993464

appId

Your CDP365 Application ID.

e4e8d06e-4d97-43df-93e8-c36238147ca0

If you haven't had your Application ID, please follow this instruction.

3. Additional steps (Optional)

Tracking Screen View Event

By default, the Antsomi SDK will fire the event screen view automatically when the Activity stack is changed, if the developer wants to control it, simply add this line after initialize

AntsomiSdk.getInstance().setTrackingScreenView(false);

Displaying Antsomi Media Template

By default, the Antsomi SDK will not display the media template from Antsomi customer journeys, if you want to show it, add this line after initialize

AntsomiSdk.getInstance().setIsShowTemplate(true);

NEXT STEP

Last updated