Android:确定应用程序使用情况
我正在开发一个项目(或者将是,如果可能的话),我需要做的关键事情之一是确定应用程序的使用情况。也就是说,哪个应用程序使用最频繁、使用时间最长。
我花了很长时间努力寻找一种直接做到这一点的方法,但一无所获。我知道像 Spare Parts 这样的东西是通过使用私有 API 来实现的,但显然这对我没有帮助。谁能推荐一些有效的方法来收集我需要的数据,或者另一种方法来确定我需要弄清楚的事情?
I'm working on a project (or will be, if this is possible), and one of the key things I need to do is determine application usage. That is, what application are being used most often, and for the longest amount of time.
I have searched long and hard for a way to directly do this, and have come up with nothing. I know that things like Spare Parts achieve it by using private APIs, but obviously that doesn't help me. Can anyone recommend some effective way to gather the data I need, or another way in which to determine the things I need to figure out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在 Android 机器上运行 powertop 吗?这是一个很棒的工具,但它可能需要默认内核版本不支持的基础设施。
oprofile<与电源不太直接相关,但仍然能够为您提供完整的系统信息/a>.它也可能需要默认内核构建中不支持的基础设施,但它可以显示完整的系统分析信息。
Can you run powertop on Android machines? It's an awesome tool, but it may require infrastructure not supported in default kernel builds.
Less directly related to power, but still capable of giving you full-system information is oprofile. It too might require infrastructure not supported in default kernel builds, but it can show full-system profiling information.
您需要将仪器添加到您自己的应用程序中,以跟踪每个活动的时间。平台中没有这方面的API。
You will need to add instrumentation to your own application that keeps track of the time in each activity. There is no API for this in the platform.