在Android中跟踪屏幕时间 [英] Tracking screen time in android

查看:72
本文介绍了在Android中跟踪屏幕时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于一个大学项目,我必须跟踪android智能手机的屏幕时间.很难找到合适的搜索结果,因为我的搜索引擎只建议已经为您做到的应用程序.我对这些应用程序的执行方式感兴趣.我认为,Android上有一个本地API对此提供支持.不幸的是,我找不到已经做到这一点的任何东西.

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.

该应用程序应该运行一项小服务,该服务会跟踪屏幕活动和其他内容(例如位置)的时间.如果您中的某人可以帮助我解决在哪里找到示例以及在哪里找到有关android API的信息,那将是很棒的事情.

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.

修改:更精确一点:这是关于整个屏幕时间,而不是特定应用程序的屏幕时间.

推荐答案

广播操作可能是为此的解决方案,

Broadcast Actions might be a solution for this,

ACTION_SCREEN_ON

ACTION_SCREEN_ON

ACTION_SCREEN_OFF

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

这篇关于在Android中跟踪屏幕时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆