Migrate from v2.0.0 to v3.0.0

Medallia Experience Orchestration SDK for Android v3.0.0 advances the minimum supported API to 28 and gets disabled for APIs less than 28. Compilation and integration is unaffected for APIs 21 - 27, however, the RequiresApi annotation has been added to all public APIs, which could affect your build compilation.

Medallia Experience Orchestration SDK for Android v3.0.0 also bumps the SDK's compile and target API to 34. This change will require adding coreLibraryDesugaring dependency to your project.

Also, APIs with Legacy Support have been removed. If they were used in your project, you would need to migrate to using standard APIs.

  1. RequiresApi annotation.

    If an app's minimum supported API is lower than 28, any usage of an API will now result a build failure that must be resolved. The usual Android practice is to surround an API call with a version check in order to resolve build error in your project.

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
    	mxoConfigureLogging {
    		levels = mutableSetOf(MXOLogLevel.VERBOSE)
                    components = mutableSetOf(MXOLogComponent.ANY)
    	}
    }
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.P) {
    	mxoLoggingConfiguration = new MXOLoggingConfiguration.Builder()
    		.log(MXOLogLevel.VERBOSE)
    		.log(MXOLogComponent.ANY)
    		.build();
    }
  2. Add coreLibraryDesugaring dependency.

    Update your app-level build.gradle.kts or build.gradle with the following:

    1. Add dependency.
      dependencies {
          	coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:{LIB_VERSION}")
      }
      dependencies {
          	coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:{LIB_VERSION}"
      }
    2. Enable library support.
      compileOptions {
          	isCoreLibraryDesugaringEnabled = true
      }
      compileOptions {
          	coreLibraryDesugaringEnabled true
      }
  3. Remove Legacy Support.

    Migrate from using Legacy Support APIs to standard APIs by replacing the following code:

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
    	MedalliaMXO.sendInteraction(true, sendInteractionRequest);
    } else {
    	MedalliaMXO.sendInteractionLegacySupport(true, sendInteractionRequest);
    }
    

    with just this:

    MedalliaMXO.sendInteraction(true, sendInteractionRequest);
You have now successfully migrated to the MXO SDK version 3.0.0.