1: Get Packagemanager Get all statically installed apps:
?
1 |
PackageManager pm = getPackageManager(); <br>List<PackageInfo> infos = pm.getInstalledPackages( 0 ); <br><br>icon : info.applicationInfo.loadIcon(pm)<br>appName : info.applicationInfo.loadLabel(pm) |
2: Get Activitymanager Get dynamic all running processes
?
12 |
ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); List<RunningAppProcessInfo> infos = am.getRunningAppProcesses();<br><br>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
[Android Pro] Get the app that the phone has installed and get all the processes that are currently running (one UID corresponds to multiple PID)