I'm trying to have an android app that can track screentime, and after x amount of time in an app, bring up a popup. Not very complicated, but I'm trying to find an effective method of knowing that the user has spent x amount of time in the app
The best I've come up with is to check UsageEvents for new foreground apps, and start a count from there. The issue with this is that it seems like a waste of resources to be constantly checking UsageEvents