4

for a university project I have to track the screen time of an android smartphone. It's hard to find proper search results, because my search engines do only suggest apps, that already do this for you. I am interested in how these apps do this. I assume, there is a native API on android which supports you with this. Unfortunately, I can't find anything that already does this.

The app is supposed to run a little service which tracks the time of the screen activity and other stuff (like location). It would be great, if someone of you can help me out on where to look for examples and where to find information about the android API.

Edit: To be a bit more precise: It's about the overall screen time, not about the screen time a specific app has.

Shiny
  • 4,945
  • 3
  • 17
  • 33
whoismax
  • 41
  • 3

1 Answers1

0

Broadcast Actions might be a solution for this,

ACTION_SCREEN_ON

ACTION_SCREEN_OFF

https://developer.android.com/reference/android/content/Intent.html#ACTION_SCREEN_ON

https://developer.android.com/reference/android/content/Intent.html#ACTION_SCREEN_OFF