# Integrate APM for Android App

**URL:** <https://discuss.elastic.co/t/integrate-apm-for-android-app/149752>\
**Category:** APM\
**Created:** [September 25, 2018, 1:20am UTC](https://discuss.elastic.co/t/integrate-apm-for-android-app/149752 "2018-09-25T01:20:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![nandan\_bigdata](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@nandan\_bigdata](https://discuss.elastic.co/u/nandan_bigdata)\
**Post date:** [September 25, 2018, 1:20am UTC](https://discuss.elastic.co/t/integrate-apm-for-android-app/149752/1 "2018-09-25T01:20:04Z")

</div>

Hi All,  
How to integrate APM with Android APP to monitor App user's activities.  
Currently my app is having 5+ millions users and I want to check how users are using my APP as well as monitor my APP performance.

Thanks

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [September 25, 2018, 6:09am UTC](https://discuss.elastic.co/t/integrate-apm-for-android-app/149752/2 "2018-09-25T06:09:45Z")

</div>

Hi and thanks for checking out Elastic APM!

The Java agent does not have support for Android apps yet. It's also not on our immediate roadmap but might be something we are looking into in the future.

How would you envision the agent to work in an Android app? Would every button click be a Transaction? What would the name of that transaction be?

You could have a look at the documentation of the APM Server intake API which lets you send transactions and spans as JSON-encoded data to the server: [https://www.elastic.co/guide/en/apm/server/current/intake-api.html](https://www.elastic.co/guide/en/apm/server/current/intake-api.html)

Cheers,  
Felix

---

<div class="post-metadata">

**Author:** ![nandan\_bigdata](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@nandan\_bigdata](https://discuss.elastic.co/u/nandan_bigdata)\
**Post date:** [September 25, 2018, 6:17am UTC](https://discuss.elastic.co/t/integrate-apm-for-android-app/149752/3 "2018-09-25T06:17:08Z")

</div>

Thanks for reply.  
Currently I am looking for below concept :-

1. Ship Android Log into Elasticsearch and visualize using kibana.
2. Want to know which view is getting accessing by users.
3. Want to monitor user's click actions as suppose user is opening my app, after that user moved to product page, then user move to product description page, then user added product into cart, then user check out.  
In this whole process user completed their process which visiting 5 pages. So I want to record that transaction too.

Currently I am having 2 Android app, 2 IOS APP, and 2 Websites.

---

<div class="post-metadata">

**Author:** ![nandan\_bigdata](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@nandan\_bigdata](https://discuss.elastic.co/u/nandan_bigdata)\
**Post date:** [September 25, 2018, 6:37am UTC](https://discuss.elastic.co/t/integrate-apm-for-android-app/149752/4 "2018-09-25T06:37:07Z")

</div>

It is like, OnClickListner on each and every buttons.

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [September 25, 2018, 7:02am UTC](https://discuss.elastic.co/t/integrate-apm-for-android-app/149752/5 "2018-09-25T07:02:56Z")

</div>

Shipping all logs to Elasticsearch might be problematic. If your users are on a mobile network, it can eat up their data volume. If your application logs periodic events in the background, continuously sending log data to the server can drain the battery because it keeps the mobile connection to the antenna open.

One idea would be to buffer locally and to send data in batch as soon as the user has a wifi connection.

Another challenge is that the Dalvik VM does not support bytecode manipulation. So instrumentation has to be performed in a build step. Thankfully, Byte Buddy has plugins for Maven and Gradle which support this.

Also, all dependencies of the agent have to be reviewed to check wether they work on Android. For example, I'm not sure if `sun.misc.Unsafe` is supported on Android, which is needed for JCTools and the LMAX Disruptor.

Another piece of the puzzle is the instrumentation to instrument the button clicks and view changes.

Not saying all this is impossible, but there is quite some work required which is why it would take some while to support that. If you are interested in collaborating I'm happy to assist 🙂

Cheers,  
Felix

---

<div class="post-metadata">

**Author:** ![nandan\_bigdata](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@nandan\_bigdata](https://discuss.elastic.co/u/nandan_bigdata)\
**Post date:** [September 25, 2018, 7:53am UTC](https://discuss.elastic.co/t/integrate-apm-for-android-app/149752/6 "2018-09-25T07:53:36Z")

</div>

How about get all onclick event data into a log file and then using logfile to index into elasticsearch ?

Yes you are correct in case of data volume issue and we can manage as once user will join WIFI, clicks data will transfer. But here one catch is "What if user will not connect with WIFI? 🙂 "

---

<div class="post-metadata">

**Author:** ![yirduhudro](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@yirduhudro](https://discuss.elastic.co/u/yirduhudro)\
**Post date:** [September 27, 2018, 12:17pm UTC](https://discuss.elastic.co/t/integrate-apm-for-android-app/149752/7 "2018-09-27T12:17:59Z")

</div>

Is there really [kodi](https://kodi.software/) any way to [showbox](https://showbox.run/) do it? Even if paid I would love [tutuapp](https://dltutuapp.com/tutuapp-download/) to have such tracking system.

Regards,  
Smith

---

<div class="post-metadata">

**Author:** ![nandan\_bigdata](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@nandan\_bigdata](https://discuss.elastic.co/u/nandan_bigdata)\
**Post date:** [October 11, 2018, 6:22am UTC](https://discuss.elastic.co/t/integrate-apm-for-android-app/149752/9 "2018-10-11T06:22:13Z")

</div>

As of now I am still keep search for solution about how to tract users activity and perform user behavior analysis

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 11, 2018, 3:08am UTC](https://discuss.elastic.co/t/integrate-apm-for-android-app/149752/12 "2018-11-11T03:08:33Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
