问题描述
我目前正在开展一项基于健康的项目,重点是个人智能手机的使用.为此,我想监视他的触摸屏使用方式,即他将手按在屏幕上已有多长时间.当超过此限制时,将生成一个阈值警告他.
我需要知道我能够在后台跟踪某个人的屏幕使用情况(例如,当他使用手机中的所有其他应用程序时)如果是这样,哪些功能对我有帮助?
出于隐私和安全原因,Android不支持此功能.
欢迎您拦截所有屏幕触摸,以了解用户何时触摸屏幕.但是,屏幕触摸对于基础应用程序将不可用,因此用户将无法使用该设备.
欢迎您查看实现 AccessibilityService
的信息,以便能够找到有关所有应用程序中用户输入的信息.但是,最后我检查了一下,这确实可以让您找出他在屏幕上按下手已经有多长时间了".
欢迎您创建一个自定义的Android ROM,以烘烤所需的监视,然后将该自定义ROM部署到您选择支持的任何设备上.使用自己的Android版本,您几乎可以做任何想做的事,但是那不是在做一个简单的应用程序.
在具有root用户权限的设备上,您可以使用超级用户特权运行某些内容以跟踪所有用户输入,但是我没有有关如何执行此操作的详细信息.
I am currently working on a health-based project focusing on a person smartphone usage. And for that i want to monitor his touch-screen usage pattern i.e how long he has been pressing his hands on the screen.When this limit crosses a thresh-hold value will be generated warning to him.
I need to know will i be able to track down a person screen-usage in background (i.e. while he uses all other apps in his phone)If so which functions would help me ??
Android does not support this, for privacy and security reasons.
You are welcome to intercept all screen touches, to find out when the user touches the screen. However, then the screen touches will not be available to the underlying apps, and so user will not be able to use the device.
You are welcome to look at implementing an AccessibilityService
, to be able to find out about user input in all apps. However, last I checked, this does allow you to find out "how long he has been pressing his hands on the screen".
You are welcome to create a custom Android ROM that bakes in your desired monitoring, then deploy that custom ROM on whatever devices you choose to support. With your own build of Android, you can do pretty much whatever you want, but then you are not making a simple app.
On a rooted device, you can probably run something with superuser privileges to track all user inputs, but I do not have the details about how to do that.
这篇关于在Android上的背景中检测屏幕触摸实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!