Android:检测用户的一般使用情况
我正在开发一个监控手机使用情况的应用程序(具体来说,它的使用时间)。目前,我记录电话、短信、彩信、屏幕打开、屏幕关闭和钥匙锁解锁的时间。现在我想确定用户何时进行除上面列出的交互之外的任何交互。例如:
1)应用程序使用(检测应用程序何时由用户启动和/或何时被用户主动使用)
为此,我一直在使用活动管理器,但似乎没有一个好的方法获取我需要的信息。它有关于前台、后台以及正在运行哪些服务的信息,但缺乏关于使用量、使用时间、应用程序启动时间等信息。
2)一般屏幕交互(检测用户何时以任何/所有方式与屏幕交互)
当我的活动不在前台时,我还没有找到任何方法来检测任何形式的一般屏幕或键盘交互。任何帮助将不胜感激。
3)其他(我对代表用户与其手机交互的其他“事件”持开放态度)
我对有关在检测用户活动时可能寻找的内容的其他想法持开放态度。
I am working on an application that monitors phone use (specifically, what time its being used). Presently, I log times of phone calls, SMSs, MMSs, Screen turning on, screen turning off, and keygaurd unlocking. Now I want to determine when the user does any interaction other than whats listed above. Like:
1) Application use (Detect when an application is launched by the user and/or when it is actively being used by the user)
For this I have been playing with the Activity Manager but there does not seem to be a good way to get the information I need. It has information about whats in the foreground, background and what services are running, but lacks information on the amount of use, time of use, time of application launch, ect.
2) General Screen Interaction (Detect when a user is interacting with the screen in any/all ways)
I have yet to find any way to detect any form of general screen or keyboard interaction while my activity is not in the foreground. Any help here would be appreciated.
3) Other (I am open to other 'events' that would represent a user interacting with their phone)
I am open to other ideas about what I could possible look for when detecting user activity.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请注意,您的 SMS/MMS 支持依赖于未记录/不受支持的 API,并且可能无法在所有设备或未来版本的 Android 上运行。
幸运的是,没有为此进行广播,以帮助限制间谍软件的范围。
幸运的是,无法确定这一点,以帮助限制间谍软件的范围。
Note that your SMS/MMS support is dependent upon an undocumented/unsupported API and may not work on all devices or in future versions of Android.
Fortunately, there are no broadcasts for this, to help limit the scope of spyware.
Fortunately, there is no way to determine this, to help limit the scope of spyware.