Android SDK upgrade

Updated at:

Prerequisites

alicloud-android-ha-adapter upgrade

1. Remove old dependencies

In your app-level Gradle file (typically <project>/<app-module>/build.gradle), remove the dependencies on the old mobile monitoring SDK from the dependencies block.

dependencies {
  // Remove the dependencies for these SDKs
  implementation('com.aliyun.ams:alicloud-android-ha-adapter:x.x.x')
  implementation('com.aliyun.ams:alicloud-android-ha-crashreporter:x.x.x')
  implementation('com.aliyun.ams:alicloud-android-tlog:x.x.x')
  implementation('com.aliyun.ams:alicloud-android-apm:x.x.x')
}

2. Remove the initialization code

Remove the old mobile monitoring SDK initialization code.

// Remove the following initialization code
AliHaConfig config = new AliHaConfig();
config.appKey = "appkey";         //appkey
config.appVersion = BuildConfig.VERSION_NAME;         // The version of your application
config.appSecret = "appsecret";  //appsecret
config.application = application;
config.context = application.getApplicationContext();
config.isAliyunos = false;          // Specifies whether the OS is YunOS

AliHaAdapter.getInstance().addPlugin(Plugin.crashreporter);
AliHaAdapter.getInstance().addPlugin(Plugin.apm);
AliHaAdapter.getInstance().addPlugin(Plugin.tlog);
AliHaAdapter.getInstance().start(config);

3. Integrate the new version

To integrate the new mobile monitoring SDK, see Integrate the Android SDK.

alicloud-apm-crash-analysis upgrade

1. Remove the old dependency

In your app-level Gradle file (typically <project>/<app-module>/build.gradle), remove the dependency on the old crash analysis SDK from the dependencies block.

dependencies {
  // Remove the dependency for this SDK
  implementation 'com.aliyun.ams:alicloud-apm-crash-analysis:x.x.x'
}

2. Integrate the new version

To integrate the new mobile monitoring SDK, see Integrate the Android SDK.