Question

An Android noobie question. Is it possible for one app to (programmatically) determine, for each app installed on a user's device:

  1. number of times each app was started (over a given time window),
  2. how long it was opened for, and
  3. how much interaction occurred over that time window

where (3) can be either user clicks or data traffic.

Does Android OS provide an API for this kind of data?

Thank you in advance for your help.

Was it helpful?

Solution

Sure, take a look at the following classes:

There are a few examples about how to do it if you look in StackOverflow for any of those classes. I don't know if you can check how many times it was launched unless you log it somehow! About the interaction maybe you could make some stats checking memory usage? :S

Hope it helps :)

OTHER TIPS

You can use the UsageStatsManager class introduced from API 21.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top