Migrating from previous Android Mobile Agent versions

Changes introduced with AppMon 2018 April

The migration steps for AppMon 2018 April are based on an AppMon 2017 May setup.

General

  • Android (native): New minSdkVersion is 15
  • Android (hybrid): New minSdkVersion is 17

Deprecated Methods/Constants/Properties

  • Methods
    • Dynatrace.startup(Context, String, String, boolean, KeyStore)
    • Dynatrace.startup(Context, String, String, boolean, KeyStore, KeyManager[])
    • Dynatrace.registerRequestTaggingInterceptor(DefaultHttpClient)
    • Dynatrace.setMonitorCookie(String)
    • Dynatrace.enableCrashReporting(boolean)
    • DTXAction.endVisit()
  • All status code values
    • DTX_CaptureOn
    • DTX_CaptureOff
    • DTX_Error_NotInitialized
    • ...
  • Auto-instrumentor properties
    • DTXInstrumentWebRequestActionWrapping
    • DTXAppType
    • DTXNameUseValueOf
    • DTXShowFullWebRequestURL

Manual instrumentation

  • The agent library was converted to an AAR library (Dynatrace.aar). It automatically adds the mandatory permissions and protects the library from obfuscation and optimizations.
  • New startup API: Dynatrace.startup(Context, Configuration)
  • Customize agent communication with the Dynatrace.setBeaconHeaders(Map<String, String>) and ConfigurationBuilder.withCommunicationProblemListener(CommunicationProblemListener) methods. This feature can be used to place custom headers (f.e. the Authorization header) on the http requests of the agent.
  • Hybrid monitoring is disabled by default to improve performace for native apps. Activated hybrid monitoring with the class AppMonConfigurationBuilder.
  • New web request timing API for 3rd-party http frameworks: WebRequestTiming.stopWebRequestTiming(String, int, String) and WebRequestTiming.stopWebRequestTiming(URL, int, String)

Auto-instrumentation

  • The DTXInstrumentWebrequestactionWrapping property is disabled by default. If you use the AppMon 2018 April Mobile Agent with an older AppMon server, you should enable it, because the older AppMon servers can't process standalone web request events.
  • Hybrid monitoring is disabled by default to improve performance for native apps. Activate hybrid monitoring with the DTXHybridApplication property.
  • The DTXAllowFileCookies property was removed (is now part of property DTXHybridApplication).
  • The DTXForceJSBridge property was removed (it is not needed anymore).
  • Disable auto-start injection with the DTXAutoStart property.

Dynatrace Gradle plugin

  • Update the Gradle plugin configuration to fetch an AppMon 2018 April Mobile Agent (use classpath 'com.dynatrace.tools:android:7.1.+')

JavaScript Bridge

The JavaScript Bridge is now deprecated. The interface will still remain in the Mobile Agent (so it will not break your code), but will be removed with upcoming versions. This means if you want to manually instrument JavaScript code, you have to insert the JavaScript Agent and use its interface to create manual actions. The Cordova plugin is already including the definitions for the JavaScript Agent. The deprecation of the JavaScript Bridge was introduced because of the WKWebView in iOS, as it runs async. Therefore the communication from JavaScript to Native is not suitable anymore.

Changes introduced with AppMon 2017 May

The migration steps for AppMon 2017 May are based on a 6.5 setup.

Manual instrumentation

  • The com.dynatrace.android.ext.jar library has been removed. You must do your own lifecycle instrumentation for activity classes that are not part of the Android SDK. See Lifecycle instrumentation for more information.

Auto-instrumentation

  • The DTXApplicationID property is mandatory. The auto-instrumentor does not use the application name as fallback. However, you can still use your application name as application ID value, if it is unique for your environment.
  • The auto-instrumentor uses the APK Signature Scheme v2 with a debug certificate to sign your instrumented APK file
  • The auto-instrumentor contains a new preparation step for multi-dex applications. See multi-dex applications for more information.
  • The auto-instrumentor can monitor OkHttp 3 web requests and OkHttp 3-based frameworks like Retrofit2.
  • The Android auto-instrumentation wizard in the AppMon Client has been removed. You shouldn't use the wizard from a 6.5 AppMon client to instrument an application with an AppMon 2017 May mobile agent. This use case is not supported.

Dynatrace Gradle plugin

  • Update the Gradle plugin configuration to fetch an AppMon 2017 May Mobile Agent (use classpath 'com.dynatrace.tools:android:7.0.+')

Changes introduced with AppMon 6.5

The migration steps for AppMon 6.5 are based on an AppMon 6.3 setup.