i want to build an app similar to StayFree but for company use only not for google play
but there is one thing that i could not achieve , which is the session count for each app also the total time spent on the app for the corresponding session , how did they implement it ? this is what I'm talking about stayfree - session , anyway this is an old screenshot , but this is what I'm looking for
also can someone suggest on a way to schedule the data to be sent to the server from all users ? so i can monitor all users on a specific date , also i want to take into consideration the offline users on a specific day.
and last thing there is some data regarding the battery consumption and network consumption in the settings app , can i read this data also ?
the data I'm getting from the UsageStats class is
long totalTimeInForeground = us.getTotalTimeInForeground();
long lastTimeUsed = us.getLastTimeUsed();
long firstTimeStamp = us.getFirstTimeStamp();
long totalTimeVisible = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
totalTimeVisible = us.getTotalTimeVisible();
}