• Home
  • Platform modules
  • Digital Experience
  • Mobile applications
  • Android

Instrument Android apps

The process of monitoring the user experience of native mobile apps is different from monitoring browser-based web applications. This is because mobile-app monitoring involves the compilation, packaging, and shipment of a monitoring library along with your own mobile application package.

Starting with OneAgent for Android version 8.261, we ended support for Java 8 for the Dynatrace Android Gradle plugin because Java 11 is required for the latest version of the Android Gradle plugin API.

Starting with OneAgent for Android version 8.245, we ended support for the following versions of Android and Android Gradle plugin:

  • Android 4.0.3 - 4.4 (API level 15 - 19)
  • Android Gradle plugin 3.1 - 3.6.

After the release, we support the following versions:

  • Android 5.0+ (API level 21+)
  • Android Gradle plugin 4.0+

To auto-instrument your Android project, use the Dynatrace Android Gradle plugin. If you are unable to use the plugin due to technical limitations, try manual instrumentation.

For technical information and references, check the following pages:

  • DSL Reference for Dynatrace Android Gradle plugin
  • JavaDoc for OneAgent SDK for Android

To learn how to monitor Xamarin apps with Dynatrace OneAgent, see Xamarin.

Get started with Android monitoring

To successfully monitor an Android app, perform the following steps.

Create a mobile application in Dynatrace

Obtain configuration settings from your mobile app

Instrument your application

Adjust OneAgent communication

Create a mobile application in Dynatrace

Before you begin instrumenting your Android app, create a mobile application in your monitoring environment. This mobile app will be used to monitor your Android app.

  1. In the Dynatrace menu, go to Deploy Dynatrace.
  2. Scroll down, and select Set up mobile monitoring.
  3. Enter a name for your app, and select Create mobile app.
    The app settings page opens.

Obtain configuration settings from your mobile app

When you create a mobile app in Dynatrace, an applicationId is generated and the beaconUrl value of your environment is determined. These values can be accessed on the Instrumentation page.

  1. In the Dynatrace menu, go to Mobile.
  2. Select the mobile app that you want to configure.
  3. Select More (…) > Edit in the upper-right corner of the tile with your app name.
  1. From the app settings, go to Instrumentation wizard.
  1. Select Android, and then go to either the Groovy (build.gradle) or the Kotlin (build.gradle.kts) tab.

The Gradle snippet is already populated with the applicationId and beaconUrl configuration values from your mobile application.

Instrument your application

Your application is now ready for instrumentation. The Dynatrace Android Gradle plugin integrates the auto-instrumentation process into your Android build. Follow these steps to begin instrumenting.

Adjust OneAgent communication

After you have finished instrumenting your application, you must adjust OneAgent communication.

Dynatrace Android Gradle plugin

  • Instrumentation via Dynatrace Android Gradle plugin
  • Monitoring capabilities of Dynatrace Android Gradle plugin
  • Configure Dynatrace Android Gradle plugin for instrumentation processes
  • Adjust OneAgent configuration via Dynatrace Android Gradle plugin
  • Change Dynatrace Android Gradle plugin configuration based on the project structure

OneAgent SDK for Android

  • Instrumentation via OneAgent SDK for Android
  • Adjust communication with OneAgent SDK for Android
  • Standalone manual instrumentation using OneAgent SDK for Android

Troubleshooting

  • Dynatrace Android Gradle plugin FAQs
  • Debug logging for OneAgent

Data privacy

Configure data privacy settings for mobile applications
Data safety form for Android