应用程序在 BlackBerry 中使用多长时间
我发现可以通过“ApplicationManager”类中的 getVisibleApplications()
了解哪些应用程序正在运行,但是,是否可以知道这些应用程序使用了多长时间?
谢谢
I've seen is posible to know what applications are running with getVisibleApplications()
from "ApplicationManager" class but, is it possible to know how long were these applications used?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您确实需要此信息,这是可能的。
您可以让后台进程启动一个计时器,并且每 N 分钟它可以调用 getVisibleApplications() 并跟踪已添加或删除到列表中的内容。
困难在于在准确数据和电池寿命之间找到适当的平衡,因为非常小的 N(秒/分钟)值将阻止设备休眠并导致电池寿命严重缩短。 N 值非常大对电池寿命的影响很小,但数据不会很准确。
您还可以将其与事件结合起来......也许您会在背光打开时积极监视,在背光关闭时每小时监视一次。
不太确定你想做什么,所以如果这根本没有帮助,我很抱歉。
If you really needed this information it would be possible.
You could have a background process start a timer and every N minutes it could call getVisibleApplications() and keep track of what has been added or removed to the list.
The difficulty is finding the right balance between accurate data and battery life as a very small value of N (seconds/minutes) will prevent the device from sleeping and will cause severe battery life degradation. A very large value of N will have minimal effect on battery life but the data won't be very accurate.
You could also combine it with events... maybe you would monitor aggressively when the backlight was on and hourly when it's off.
Not really sure what you're trying to do so my apologies if this doesn't help at all.
简单的答案是,不,您无法确定应用程序的使用时间。出于兴趣,你为什么想知道这个?
Simple answer is, No you cannot the duration of how long the applications were used. Out of interest, why would you want to know that?