Adjust Android Agent configuration via Android Gradle plugin

Version 8.x

This is documentation for the most recent version 8.x. It is only supported for AppMon 2018 October.

If you're using older version, see Android Agent 7.x.

The following configuration options can be used to modify the default configuration of the Android Agent. They are especially useful when used along with the auto-start injection feature.

They can also be used to adjust the Agent configuration when the manual startup approach is approached. In this case, you have to be careful because these settings might get overridden with the ConfigurationBuilder.

Data privacy

Android Agent allows you to dynamically adjust data-privacy settings so that you can build your apps in compliance with GDPR data-privacy regulations. To activate this feature (when you use the auto-start injection feature), enable the userOptIn property.

Download
dynatrace {
    configurations {
        sampleConfig {
            userOptIn true
        }
    }
}

Use the Android Agent SDK to adjust the privacy level based on user discretion. The details are available in the data privacy section of the Android Agent SDK documentation.

Hybrid apps that use the JavaScript agent inside a WebView

For hybrid apps that use the JavaScript agent, cookies must be set for each instrumented domain or server the app communicates with. When the hybrid app monitoring feature is enabled, Android Agent generates these cookies for every specified domain and stores them into the CookieManager.

All hybrid app monitoring related properties are part of HybridWebView DSL and must be configured via the hybridWebView block:

Download
dynatrace {
    configurations {
        sampleConfig {
            hybridWebView {
                enabled true
                domains '<domain1>', '<domain2>'
                domains '<anotherDomain>'
            }
        }
    }
}

You can activate the hybrid app monitoring feature with the enabled property. All used domains, hosts, and IP addresses must be specified via the domains property. Domains and sub-domains must start with a dot.