Skip to content

App Timeline

TheBotBox edited this page May 14, 2020 · 4 revisions

To query the timeline of a specific package

Monitor.scan().generateTimeline(new TimelineContracts.View() {
            @Override
            public void onTimelineGenerated(List<List<TimeLine>> timeline) {
               
            }
        }).whichPackage(packageName).fetchForToday();

As of you, timeline can only be fetched to today.

API will return a List of List of type TimeLine from which we can retrieve the open and exit timestamps of the package requested as shown in TimeLineAdapter
List<List<TimeLine>> returns the total number of the times the specific package has been opened and closed
-feature-graphic
The internal list is of fixed size 3. Fetching index 0 will return the start time, similarly index 1 will return the exit time.
For further details, refer to the sample app