• Log in


title: Android agent configuration and feature flags tags:

  • Mobile monitoring
  • New Relic Mobile Android
  • API guides metaDescription: Change New Relic for Android agent behavior by calling these optional configuration settings. redirects:
  • /docs/mobile-monitoring/new-relic-mobile-android/install-configure/android-agent-configuration
  • /docs/mobile-monitoring/new-relic-mobile-android/install-configure/android-agent-configuration-feature-flags
  • /docs/mobile-monitoring/new-relic-mobile-android/api-guides/android-agent-configuration-feature-flags

The Android agent provides configuration settings to change the default behavior of the agent. For an explanation of mobile custom data types, see Add custom data to mobile monitoring.

Change configuration settings

All settings, including the call to invoke the agent, are called in the onCreate method of the MainActivity class. To change settings, call the setting in one of two ways (if the setting supports it):

  • Change the setting on its own line for each specific condition:

    NewRelic.disableFeature(FeatureFlag.DefaultInteractions);
    NewRelic.enableFeature(FeatureFlag.CrashReporting);
    NewRelic.withApplicationToken(<NEW_RELIC_TOKEN>).start(this.getApplication());

    OR

  • Change the setting as part of the agent start call using the .with method:

    NewRelic.withApplicationToken(<NEW_RELIC_TOKEN>)
            .withDefaultInteractions(false)
            .withCrashReportingEnabled(true)
            .start(this.getApplication());

Analytics settings

Application settings

Crash and error reporting settings

Distributed tracing

Interaction settings

Networking settings

Logging settings

Data endpoint settings

Copyright © 2022 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.