# SDK configuration for custom Android app

**URL:** <https://community.dynatrace.com/t/sdk-configuration-for-custom-android-app/41955>\
**Category:** Real User Monitoring\
**Tags:** real-user-monitoring-classic, application-monitoring, android\
**Created:** [October 6, 2023, 10:40am UTC](https://community.dynatrace.com/t/sdk-configuration-for-custom-android-app/41955 "2023-10-06T10:40:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreaCaria](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@andreaCaria](https://community.dynatrace.com/u/andreaCaria)\
**Post date:** [October 6, 2023, 10:40am UTC](https://community.dynatrace.com/t/sdk-configuration-for-custom-android-app/41955/1 "2023-10-06T10:40:08Z")

</div>

Hi, we are instrumenting an android app with the dynatrace SDK version: 8.273.1.1003 ([Instrumentation via OneAgent SDK for Android in RUM Classic — Dynatrace Docs](https://www.dynatrace.com/support/help/platform-modules/digital-experience/mobile-applications/instrument-android-app/instrumentation-via-oneagent-sdk/oneagent-sdk-for-android))

Due to technical limitations on networking, we would like to limit the monitor&nbsp; **only to** &nbsp;the actions set in the code in this way:

DTXAction webAction = Dynatrace._enterAction_(“ACTION NAME”);

([Instrumentation via OneAgent SDK for Android in RUM Classic — Dynatrace Docs](https://www.dynatrace.com/support/help/platform-modules/digital-experience/mobile-applications/instrument-android-app/instrumentation-via-oneagent-sdk/oneagent-sdk-for-android#create-custom-actions))

Unfortunately, we are still seeing actions not set such as this:

- **Loading** &nbsp;SmartphoneHomeActivity
- **Loading** &nbsp;_FAST Pax Staging_
- **Touch on** &nbsp;_LinearLayout_
- **Touch on** &nbsp;_ImageView_

In this link:

> **[Instrumentation via OneAgent SDK for Android in RUM Classic](https://docs.dynatrace.com/docs/observe/digital-experience/rum-classic/mobile-applications/instrument-android-app/instrumentation-via-oneagent-sdk/oneagent-sdk-for-android)**
>
> Learn how to enrich mobile user experience monitoring in Android using OneAgent SDK.

We have seen that is possible to disable the Automatic monitor of the app but is not working.

There are any configurations that we need to set to achieve the result?

---

<div class="post-metadata">

**Author:** ![Thomas\_Wirth1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/thomas_wirth1/32/1776_2.png) [@Thomas\_Wirth1](https://community.dynatrace.com/u/Thomas_Wirth1)\
**Post date:** [October 6, 2023, 11:19am UTC](https://community.dynatrace.com/t/sdk-configuration-for-custom-android-app/41955/2 "2023-10-06T11:19:33Z")

</div>

Hey,

I assume you instrument your app with the Dynatrace Android Gradle plugin, because user actions like “Touch on ImageView” are only generated when auto-instrumentation (via the plugin) is enabled. You can verify this assumption by looking at the build.gradle files and check if the snippets from this [page](https://www.dynatrace.com/support/help/platform-modules/digital-experience/mobile-applications/instrument-android-app/instrumentation-via-plugin/instrumentation-via-plugin) were added.  
The linked setting “withActivityMonitoring” only deactivate monitoring for activity lifecycle events. Only the action “Loading SmartphoneHomeActivity” falls into this category. The other actions are generated by the different auto-instrumentation features of the Dynatrace Android Gradle plugin.

The Dynatrace Android Gradle plugin allows users to deactivate all auto-instrumentation features via the plugin DSL. When you want to deactivate ALL auto-instrumentation features, then Dynatrace recommends to remove the plugin snippets from your build.gradle files and instead use [standalone-manual instrumentation](https://www.dynatrace.com/support/help/platform-modules/digital-experience/mobile-applications/instrument-android-app/instrumentation-via-oneagent-sdk/manual-instrumentation), because the plugin affects the build time of non-incremental builds.

When the standalone-manual instrumentation is used, only two monitoring features are enabled by default: crash reporting and activity lifecycle monitoring. You can deactivate both features via the configuration builder (see [JavaDoc](https://www.dynatrace.com/support/doc/javadoc/oneagent/android/agent/com/dynatrace/android/agent/conf/ConfigurationBuilder.html))

---

<div class="post-metadata">

**Author:** ![andreaCaria](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@andreaCaria](https://community.dynatrace.com/u/andreaCaria)\
**Post date:** [October 6, 2023, 12:46pm UTC](https://community.dynatrace.com/t/sdk-configuration-for-custom-android-app/41955/3 "2023-10-06T12:46:11Z")

</div>

Hi,

thank you for your meaningful answer. I double-checked but it does not seem we are using the plugin. We did not see any code snippet that you mentioned…

We have simply added this:

dependencies&nbsp; **{**

_implementation(“com.dynatrace.agent:agent-android:8.273.1.1003”)_

in the **build.gradle.kts** file

And then start the monitoring using this guide:

**[Instrumentation via OneAgent SDK for Android in RUM Classic — Dynatrace Docs](https://www.dynatrace.com/support/help/platform-modules/digital-experience/mobile-applications/instrument-android-app/instrumentation-via-oneagent-sdk/oneagent-sdk-for-android#start-oneagent)**

Do you have any other clue?

Thanks a lot,

Andrea

---

<div class="post-metadata">

**Author:** ![Thomas\_Wirth1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/thomas_wirth1/32/1776_2.png) [@Thomas\_Wirth1](https://community.dynatrace.com/u/Thomas_Wirth1)\
**Post date:** [October 6, 2023, 2:25pm UTC](https://community.dynatrace.com/t/sdk-configuration-for-custom-android-app/41955/4 "2023-10-06T14:25:30Z")

</div>

User action monitoring is only available with auto-instrumentation or by manually generating “Touch on \<component\>” user actions. Based on the user actions names, I would assume that these actions are generated by auto-instrumentation. Because of the flexibility of Gradle, there are several other possibilities how the Dynatrace Android Gradle plugin could be added to the Android build.  
We would have to take a look at the monitoring data or the [agent debug logs](https://www.dynatrace.com/support/help/platform-modules/digital-experience/mobile-applications/instrument-android-app/troubleshooting/debug-logging-oneagent) to determine who generated these user actions. Therefore I recommend to create a support ticket, where you can privately share details about your app and Dynatrace can assist you in troubleshooting this problem.
