Migrating from previous Android Mobile Agent versions

Version 7.x

This is documentation about migration to the legacy version 7.x. For instruction on migration to the most recent version see Migrate to Dynatrace Android Gradle plugin version 8.x.

Version 8.x is only supported with AppMon 2018 October!

Changes introduced with AppMon 2018 October

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


The support of the JSNativeBridge interface is discontinued. Instead use the JavaScript Agent to instrument hybrid apps. With this change the new minSdkVersion for hybrid apps is 15 again.

Manual instrumentation

  • The support for Apache HttpClient in the Android Agent library is discontinued, as Android no longer officially supports it since Android 6. You can still monitor web requests made with this library by using the generic web request monitoring method calls.
  • Support for endVisit() calls inside a user action is discontinued, as it caused correlation issues. Instead, simply call endVisit() outside of any user action.
  • The setMonitorCookie(String) call is removed and replaced with the more generic setBeaconHeaders(Map<String, String>) call.
  • The old startup method calls are removed and replaced with the more generic method call startup(Context, Configuration).


  • Standalone web requests are no longer wrapped inside of actions, because standalone web requests are supported since the AppMon 2018 April release. All properties, that are related to web request wrapping, are no longer available: DTXInstrumentWebRequestActionWrapping, DTXShowFullWebRequestURL, DTXNameUseValueOf and DTXAppType
  • Because of security concerns the loading of BKS files was removed (DTXBKSFileName and DTXBKSPassword properties). The KeyStore file must be loaded manually and set via the ConfigurationBuilder.

Dynatrace Gradle plugin

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

Changes introduced with AppMon 2018 April

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


  • 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)


  • 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.


  • 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.