4

I need to track usage time of all installed apps, with java, in android OS. For example, this app is very very similar: https://play.google.com/store/apps/details?id=com.agrvaibhav.AppUsageTracking

Is there a way to do this?

Nikolay Kostov
  • 16,433
  • 23
  • 85
  • 123
GradAsso
  • 153
  • 3
  • 11

1 Answers1

3

First of all you can use the android.app.ActivityManager to retrieve phone statue and running processes. An excellent example of doing this could be found here,

Java Code Examples for android.app.ActivityManager

You can also monitor the foreground activity to determine the Running tasks. Example here,

how do android monitor usage applications work

Lastly you can create your own service to detect each running process and their usage. A complete example of this procedure could be found here,

App to monitor other apps on android

Community
  • 1
  • 1
Prokash Sarkar
  • 11,723
  • 1
  • 37
  • 50