AppTimer is a android library which provides the time spent by the user on each app. AppTimer supports until Android Kitkat. It uses GET_TASKS permission to retrieve the app which is running in the foreground. AppTimer in 2 steps
- Initialize Library:
AppTimer.initialize(context);
- Retrieve Time Stats:
List list = AppTimer.getTimeStats(context);
- The structure of TimeStats is:
public class TimeStat {
public String packageName;
public long time;
}
AppTimer is available on jcenter. Please ensure that you are using the latest version by checking here
Gradle:
compile 'com.ndesh:app-timer:0.0.1'
MIT