Developer Guide
API GuideDeveloper Guide
  • Overview
    • Getting Started
    • Customers and Visitors
    • Events and Business Objects (BOs)
      • Sample Event Templates
  • Website
    • Getting Started
      • Direct JS Implementation
      • JS Integration via GTM
      • Tracking Haravan website events
    • Tracking Users
    • Tracking Events
      • [Direct] Sample E-Commerce Events
        • View Product
        • Add a Product to the Shopping Cart
        • View the Shopping Cart
        • Remove a Product from the Shopping Cart
        • Search for Product(s)
        • Checkout Shopping Cart
        • Apply Promotion Code
        • Purchase Product(s)
      • [GTM] Sample E-Commerce Events
        • View Product
        • Add a Product to the Shopping Cart
        • View the Shopping Cart
        • Remove a Product from the Shopping Cart
        • Search for Product(s)
        • Checkout Shopping Cart
        • Apply Promotion Code
        • Purchase Product(s)
    • Web Push
  • Android
    • Getting Started
    • Tracking Users
    • Tracking Events
    • Push Messaging
    • App Inbox Messaging
  • iOS
    • Getting Started
      • Integration of Antsomi iOS SDK
    • Tracking Users
    • Tracking Events
    • Push Messaging
  • Hybrid Apps
    • React Native
      • Tracking Users
      • Tracking Events
        • Sample E-Commerce Events
          • View Product
          • Add a Product to the Shopping Cart
          • View the Shopping Cart
          • Remove a Product from the Shopping Cart
          • Search for Product(s)
          • Checkout Shopping Cart
          • Apply Promotion Code
          • Purchase Product(s)
      • Push Messaging
      • App Inbox Messaging
    • Flutter
      • Tracking Users
      • Tracking Events
        • Sample E-Commerce Events
          • View Product
          • Add a Product to the Shopping Cart
          • View the Shopping Cart
          • Remove a Product from the Shopping Cart
          • Search for Product(s)
          • Checkout Shopping Cart
          • Purchase Product(s)
      • Push Messaging
      • App Inbox Messaging
      • App In-line Content
  • Antsomi Service Integrations
    • Media Template
    • Media JSON
      • Sample E-Commerce Events
        • Search for Product(s)
        • View Product
        • Add a Product to the Shopping Cart
        • Checkout Shopping Cart
        • Purchase Product(s)
      • Sample User Events
        • Sign-in
        • Sign-up
      • Sample Opt-in Events
        • Subscribe to Email marketing
        • Subscribe to OneSignal channel
  • 3rd Party Integrations
    • Shopify
      • Tracking Shopify website events
    • LINE
      • Integrating LINE Login with your web app
    • Google Ad Manager
      • Targeting CDP365 segment via PPID(s)
Powered by GitBook
On this page
  • 1. Installation
  • 2. Initialization
  • Step 1: Import Antsomi packages in your Application class.
  • Step 2: Initialize Antsomi SDK
  • 3. Additional steps (Optional)
  • Tracking Screen View Event
  • Displaying Antsomi Media Template
  1. Android

Getting Started

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

PreviousWeb PushNextTracking Users

Last updated 3 months ago

1. Installation

The easiest way to use Antsomi SDK in your Android project is with . 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.1.50'
}

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:

Key
Description
Example

portalId

Your CDP365 Portal ID.

564890637

sourceId

Your CDP365 Event Source ID.

564993464

appId

Your CDP365 Application ID.

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

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

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

Maven
instruction
Tracking User Attributes
Tracking User Events
Configure Push Messaging
Configure App Inbox Messaging