How can I get my app screen time on a hourly basis?

Yogesh Paliyal

Android's UsageStatsManager returning data for minimum one day, but I want to get accurate data from 12 am to the current time. I tried several types but nothing works properly. The "Action Dash" and "Digital Wellbeing" is getting data accurately.

Tanjim Khan

Use queryEvents method of UsageStatsManager class.

I've recently built an app for tracking daily app usage. Firstly, I tried using queryUsageStats but it didn't work properly. I thought it was supposed to return usage time from 12 am to current time when INTERVAL_DAILY is passed to it, but instead it was returning something else. Maybe there is a bug or there is something wrong on my side related to time zone or something.

Anyway, then I tried queryEvents and it worked fine.

Here's my implementation (See both the question and the accepted answer).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to get data on an hourly basis

How can i schedule pyspark script on hourly basis on linux enviroment

How to split a time into hourly basis in php

How can I call Screen Time by setting from my app at iOS12

How can I schedule hourly request to a server and store data on my own server to access from iOS app?

How can I know when my screen was locked last time?

how to interpolate on hourly basis

How can I plot hourly averaged time series grouped by month?

How can I open my Android app through share screen?

How can i add UIActivityIndicator to Splash screen of my app?

How can i add lottie loading screen on my app?

How can I tell if my hourly cron job has run?

How can I get the appointment status on the Release Time Activities screen

My app shows a splash screen. How can I make my test wait for the main screen?

How can I get the position of Powerpoint Mac in my screen?

How can I get the S/N of my laptop display screen?

How can I get this look on my welcome screen? flutter

how can i get conditonal hourly mean in pandas?

How to get steps count on hourly basis from HealthKit Swift 4

How to get data from oracle database in hourly basis

How can I get this App Store purchase window in my app?

How can I add a dynamic date time picker to my app?

How can i get my query execution time in logging

How can I get my time strings in a right format?

In python how can I get the date and time of my local server?

How can I get the exact time from my laptop?

How do I keep the screen on in my App?

Can't get Combine subscription to work every time I route to the main screen of the app

How can i redirect my app to a lock screen when reenter app