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 SDK for Android version 8.245, we're ending support for the following versions of Android and Gradle plugin:
- Android 4.0.3 - 4.4 (API level 15 - 19)
- Android Gradle plugin 3.1 - 3.6.
After the release, we'll support the following versions:
- Android 5.0+ (API level 21+)
- Android Gradle plugin 4.0+
For technical information and references, check the following pages:
To learn how to monitor Xamarin apps with Dynatrace OneAgent, see Xamarin.
To successfully monitor an Android app, perform the following steps:
Step 1: 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.
- In the Dynatrace menu, go to Deploy Dynatrace.
- Scroll down, and select Set up mobile monitoring.
- Enter a name for your app, and select Create mobile app.
Step 2: 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.
- In the Dynatrace menu, go to Mobile.
- Select the mobile app that you want to configure.
- Select More (…) > Edit in the upper-right corner of the tile with your app name.
- From the app settings, go to Instrumentation wizard.
- 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
beaconUrl configuration values from your mobile application.
Step 3: Instrument your application
Step 4: Adjust OneAgent communication
After you have finished instrumenting your application, you must adjust OneAgent communication.
- 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