1: 获取PackageManager 获取全部静态已安装的应用

PackageManager pm = getPackageManager(); 
List<PackageInfo> infos = pm.getInstalledPackages(0);

icon : info.applicationInfo.loadIcon(pm)
appName : info.applicationInfo.loadLabel(pm)

2:获取ActivityManager获取动态所有正在运行的进程

ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);List<RunningAppProcessInfo> infos = am.getRunningAppProcesses();

info.processName + " ; " + info.uid + " ; " + info.pid
类似如下输出: 

10-20 13:43:16.047: I/System.out(28009): com.qihoo360.mobilesafe:FloatWindow ; 10057 ; 27991
10-20 13:43:16.047: I/System.out(28009): com.qihoo360.mobilesafe:GuardService ; 10057 ; 25390
10-20 13:43:16.047: I/System.out(28009): com.qihoo360.mobilesafe:clear ; 10057 ; 27532

更多相关文章

  1. Nginx系列教程(四)| 一文带你读懂Nginx的动静分离
  2. 一款霸榜 GitHub 的开源 Linux 资源监视器!
  3. java 非静态内部类为什么持有外部类的引用
  4. SystemUI下的RecentActivity
  5. android 6.0以上添加动态权限,多条权限一起请求
  6. android gridview点击子选项动态改变item背景颜色
  7. Android(安卓)技巧 - 取得当前活动的activity的class name / pac
  8. android 播放网络或本地gif格式的动态图片
  9. android如何让service不被杀死-提高进程优先级

随机推荐

  1. android 保持屏幕长亮及解锁的方法
  2. Android中使用Intent打开本地图库
  3. test
  4. android按钮main.xm_基础篇
  5. Android(安卓)Drawable、Bitmap、byte[]
  6. CollapsingToolbarLayout标准使用方式
  7. Android和IOS录制mp3语音文件的方法
  8. android 打开和关闭软件盘
  9. Android(安卓)代理设置
  10. adb fastboot 烧机 和 编译android的几个