安装了Java的Andr​​oid轨使用时间的应用程序 [英] Java android track usage time installed app

查看:159
本文介绍了安装了Java的Andr​​oid轨使用时间的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要追踪所有安装的应用程序的使用时间,用java,在Android操作系统。
例如,这个程序是非常非常相似: https://开头播放.google.com /存储/应用程序/详细信息?ID = com.agrvaibhav.AppUsageTracking

I need to track usage time of all installed apps, with java, in android OS. For example, this app is very very similar: https://play.google.com/store/apps/details?id=com.agrvaibhav.AppUsageTracking

有没有办法做到这一点?

Is there a way to do this?

推荐答案

首先,你可以使用 android.app.ActivityManager 以获取手机雕像和正在运行的进程。这样做的一个很好的例子可以在这里找到,

First of all you can use the android.app.ActivityManager to retrieve phone statue and running processes. An excellent example of doing this could be found here,

的Java code为Android例子.app.ActivityManager

您还可以监控前台活动,以确定正在运行的任务。例如,在这里,

You can also monitor the foreground activity to determine the Running tasks. Example here,

<一个href=\"http://stackoverflow.com/questions/17629053/how-do-android-monitor-usage-applications-work\">how做Android的显示器使用应用程序的工作

最后,你可以创建自己的服务来检测每个正在运行的进程及其用法。此过程的一个完整的例子可以在这里找到,

Lastly you can create your own service to detect each running process and their usage. A complete example of this procedure could be found here,

应用监控在Android 其他应用

这篇关于安装了Java的Andr​​oid轨使用时间的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆