Integrate the Android SDK for MXO in your App

Before you can deploy the integration, you must ensure the SDK is set up with the correct configuration parameters.

You can download the latest SDK and review the extended integration instructions from Github:

Android SDK for MXO

Minimum API Level

The minimum supported API level is API 28 (Android 9). If your API level is between API 21 and API 28, the MXO SDK will be disabled for your project. Please contact our support team so we can understand how to best mitigate this.

Installation and Environment Setup

We provide the SDK as an AAR file. You can either integrate the SDK via Maven or import it manually as an AAR module under your project. When integrating the SDK ensure that you:

  1. Add the SDK dependencies under your application build.gradle file.
  2. Subclass the Application class.
  3. Update your apps Manifest file.

The aim of the automatic integration is to produce two build variants:

  1. Admin mode. Admin mode provides you with an interface that lets you add Activity Capture Points to interactions and elements, Attribute Capture Points to elements, and preview your configuration before publishing it to your live environment.

    The Admin mode build should only be distributed internally to business users involved in MXO setup. This is your internal dev build.

  2. User mode. The User mode build should be made available through the Play Store, when you are satisfied that all insights are being tracked in Admin mode and internal QA requirements have been met.

Step 1: Finding your Integration Parameters in MXO

You need to provide specific information about your MXO environment when integrating your mobile solution with the SDK. These integration parameters include:

  • Site Key (for your specific Space)
  • Touchpoint URI
  • Host name. Typically, this is https://na5.thunderhead.com or https://eu2.thunderhead.com.

Step 2: Define the SDK Configuration Parameters using the Integration Parameters for your Space

Configure the SDK using the integration parameters specific to your MXO environment.

Example

Initialization parameters example for your Android app.

const val SITE_KEY = "ONE-XXXXXXXX-6100" 
const val HOST = "https://xx.thunderhead.com" 
const val TOUCHPOINT = "android://myAndroidAppTouchpointUri"
private static final String siteKey = "ONE-XXXXXXXX-6100"; 
private static final String host = "https://xx.thunderhead.com";
private static final String touchpointURI = "android://myAndroidAppTouchpointUri";

Step 3: Configure the SDK in Admin mode

Configure the SDK in Admin mode and use this to create your Admin mode Build for internal distribution.

import com.medallia.mxo.mxoConfiguration
import com.medallia.mxo.configuration.MXOMode

class YourApplication : Application() {
	override fun onCreate() {
        	super.onCreate()
        	mxoConfiguration = mxoConfiguration {
            		this.siteKey = SITE_KEY
            		this.host = URI(HOST)
            		this.touchpoint = URI(TOUCHPOINT)
            		this.mode = MXOMode.ADMIN
        	}
	}
    
	companion object {
		const val SITE_KEY = "ONE-XXXXXXXX-6100"
        	const val HOST = "https://xx.thunderhead.com"
        	const val TOUCHPOINT = "android://myAndroidAppTouchpointUri"
    	}
}
import com.medallia.mxo.MedalliaMXO;
import com.medallia.mxo.configuration.MXOConfiguration;
import com.medallia.mxo.configuration.MXOMode;
import java.net.URI;

public class YourApplication extends Application {
	private static final String siteKey = "ONE-XXXXXXXX-6100"; 
  	private static final String host = "https://xx.thunderhead.com";
  	private static final String touchpointURI = "android://myAndroidAppTouchpointUri";
  
    	@Override
    	public void onCreate() {
      		super.onCreate();
      		final MXOConfiguration mxoConfiguration = new MXOConfiguration.Builder()
        		.siteKey(siteKey)
        		.host(URI.create(host))
        		.touchpoint(URI.create(touchpointURI))
        		.mode(MXOMode.ADMIN)
        		.build();
		MedalliaMXO.setConfiguration(mxoConfiguration);
    	}
}

Step 4: Configure the SDK in User mode

Configure the SDK in User mode and use this to create your User mode Build for publication to the Google Play Store.

import com.medallia.mxo.mxoConfiguration
import com.medallia.mxo.configuration.MXOMode

class YourApplication : Application() {
	override fun onCreate() {
        	super.onCreate()
        	mxoConfiguration = mxoConfiguration {
            		this.siteKey = SITE_KEY
            		this.host = URI(HOST)
            		this.touchpoint = URI(TOUCHPOINT)
            		this.mode = MXOMode.USER
        	}
	}
    
	companion object {
		const val SITE_KEY = "ONE-XXXXXXXX-6100"
        	const val HOST = "https://xx.thunderhead.com"
        	const val TOUCHPOINT = "android://myAndroidAppTouchpointUri"
    	}
}
import com.medallia.mxo.MedalliaMXO;
import com.medallia.mxo.configuration.MXOConfiguration;
import com.medallia.mxo.configuration.MXOMode;
import java.net.URI;

public class YourApplication extends Application {
	private static final String siteKey = "ONE-XXXXXXXX-6100"; 
  	private static final String host = "https://xx.thunderhead.com";
  	private static final String touchpointURI = "android://myAndroidAppTouchpointUri";
  
    	@Override
    	public void onCreate() {
      		super.onCreate();
      		final MXOConfiguration mxoConfiguration = new MXOConfiguration.Builder()
        		.siteKey(siteKey)
        		.host(URI.create(host))
        		.touchpoint(URI.create(touchpointURI))
        		.mode(MXOMode.USER)
        		.build();
		MedalliaMXO.setConfiguration(mxoConfiguration);
    	}
}