Kindly help to figure out a way so that I can find time spent on each application package in Android KK device .
In Android 5.0+ version we have Usage Stats api to get the stats related to app packages in the system.
reference to Android 5.0 : Using usageStats.getTotalTimeInForeground() to get the time every application in a device spent in foreground
How to get relevant data for package in Android KitKat.
Thanks in advance .