Search code examples
androidvisited

What is the best approach to know when a user visit an specific section in my app?


I'm developing a commerce guide app. Inside the app, are going to be a list of different commerces with his own private section called CommerceActivity.java. Inside that activity I will display all the information about a specific commerce that the user choose to see.

Now, I would like to keep account of the visits for each commerce. I thought of placing a piece of code in CommerceActivity whose function is to save a *.txt file on my server that in his name contains the ID of the user device, the name of commerce visited and time of the visit, so after performing the visual count the visits. Do you know a better aproach for this? Thank you for your time.


Solution

  • I like Google Analytics.

    There's a sample from Google on how to setup and use it:

    https://developers.google.com/analytics/devguides/collection/android/v4/

    Hope that helps =]