Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implement a library to track all events in an app

Tags:

android

I am trying to create a library, lets call it L. A company has an android app, say A.

L can be linked to A such that in the codes of A, the dev just needs to add something like:

L l = new L("client_id") l.startTrack();

Now L should be able to track all clicks that happens in A and pass to a server for logging. AppSee is a product that is already doing this.

I am wondering how can i intercept every user action to get the action target name (button title? textfield?)

Thank you!

like image 976
Mark KWH Avatar asked Oct 23 '15 13:10

Mark KWH


People also ask

What is app event tracking?

What Is In App Event Tracking? In app event tracking means to have a detailed overview of the post – install activities inside your app. It offers you many hints about the way users interact with your app. That allows you to improve your campaigns in terms of acquisition, engagement, and retention.

What is Android event handling?

Android Event Handlers Event Handlers are useful to define several callback methods when we are building custom components from view. Following are some of the commonly used callback methods for event handling in android applications. Method. Description. onKeyDown()

Which is called when the user navigates onto or away from the item?

OnFocusChangeListener . This is called when the user navigates onto or away from the item, using the navigation-keys or trackball.

What is mixpanel in Android?

Mixpanel is the most advanced analytics platform which is used to track user interaction with the web and mobile apps.


1 Answers

What you are asking is EventTracking, like in GoogleAnalytics. But the approach you are doing is different. In Google analytic one needs to start event to event tracker. Like say you have a 3 buttons and you need to track each button separately, there you put 3 separate events trackers.

If you want to track all the events going through the activity you need to implement Activity's onInterceptTouchEvent(). Whenever a touch event happens in an activity, it passes through the said method above.

As Google says

Implement this method to intercept all touch screen motion events. This allows you to watch events as they are dispatched to your children, and take ownership of the current gesture at any point.

with caution

Using this function takes some care, as it has a fairly complicated interaction with View.onTouchEvent(MotionEvent), and using it requires implementing that method as well as this one in the correct way.

For more Event details, look here.

like image 92
Murtaza Khursheed Hussain Avatar answered Oct 29 '22 13:10

Murtaza Khursheed Hussain