Configuring the Android SDK
The Medallia Experience Orchestration SDK does not support partial, or piecemeal, configuration. You must provide all parameters, either all valid or invalid (empty string
or null
). When configured with invalid parameters, the SDK is set in an unconfigured state.
The Medallia Experience Orchestration SDK for Android supports User and Admin modes:
Admin mode — Admin mode provides you with an interface to add Activity Capture Points to Interactions and elements, Attribute Capture Points to elements, and preview your configuration before publishing it to your live environment.
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.
Setting up the SDK in User mode for Play Store builds
To start capturing, and receiving Optimizations with the Medallia Experience Orchestration SDK in User mode, you must first configure it with your Medallia Experience Orchestration parameters.
For more information on finding these parameters, see here.
When you have your parameters, configure the SDK.
We recommend adding the following lines of code for User mode under the Application
's subclass onCreate()
method. You must ensure the mxoConfiguration
top-level Kotlin property is set or the MedalliaMXO.setConfiguration
Java method is invoked after super.onCreate()
is called.
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-XXXXXXXXXX-1022"
const val HOST = "https://xx.thunderhead.com"
const val TOUCHPOINT = "myAppsNameURI"
}
}
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-XXXXXXXXXX-1022";
private static final String host = "https://xx.thunderhead.com";
private static final String touchpointURI = "myAppsNameURI";
@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);
}
}
Setting up the SDK in Admin mode for internal distribution
We recommend adding the Admin mode function on your internal builds, behind a debug settings function or on a dedicated build pipeline, as described here.
To use the SDK in Admin mode, simply change the .mode
parameter to MXOMode.ADMIN
, as follows:
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-XXXXXXXXXX-1022"
const val HOST = "https://xx.thunderhead.com"
const val TOUCHPOINT = "myAppsNameURI"
}
}
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-XXXXXXXXXX-1022";
private static final String host = "https://xx.thunderhead.com";
private static final String touchpointURI = "myAppsNameURI";
@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);
}
}
Reconfiguration of the SDK
The SDK can be reconfigured as many times as necessary.
If you have configured the Medallia Experience Orchestration SDK with all valid or invalid parameters and need to update the configuration for some or all parameters, add the following code after the configuration block:
mxoConfiguration = mxoConfiguration.copy {
this.siteKey = "newSiteKey"
this.host = URI("newHost")
}
// Can be written in Java builder format if desired.
val builder = mxoConfiguration?.builder() ?: MXOConfiguration.Builder()
mxoConfiguration = builder.siteKey("newSiteKey").build()
MXOConfiguration.Builder builder = currentConfiguration != null ?
currentConfiguration.builder() :
new MXOConfiguration.Builder();
MXOConfiguration modifiedConfiguration = builder
.siteKey("newSiteKey")
.host(URI.create("newHost"))
.build();
MedalliaMXO.setConfiguration(modifiedConfiguration);
You have now successfully configured the Medallia Experience Orchestration SDK for Android.