Reputation: 137
I want to reach screen time of every application that's working on android system. For example, there are 3 hours of facebook working time but 1.2 hours of screen time. How can i get it?
Upvotes: 2
Views: 1643
Reputation:
android.app.usage
UsageStats
public final class UsageStats
extends Object implements Parcelable
java.lang.Object
↳ android.app.usage.UsageStats
What you need I think is
getFirstTimeStamp
Get the beginning of the time range this UsageStats represents, measured in milliseconds since the epoch.
and getLastTimeStamp
Get the end of the time range this UsageStats
represents, measured in milliseconds since the epoch.
Upvotes: 1