[英]Android: Determine Application Usage
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. 我知道诸如Spare Parts之类的东西都是通过使用私有API来实现的,但是显然这对我没有帮助。 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? 谁能推荐一些有效的方法来收集我需要的数据,或者另一种方法来确定我需要弄清楚的事情?
Can you run powertop on Android machines? 您可以在Android机器上运行powertop吗? 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 . oprofile与电源的关系不那么直接,但是仍然能够为您提供完整的系统信息。 It too might require infrastructure not supported in default kernel builds, but it can show full-system profiling information. 它也可能需要默认内核构建中不支持的基础结构,但是它可以显示完整的系统配置信息。
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. 平台中没有为此的API。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.