How to get Android process launch info

I want to list all the background running processes and get information about them from one background service (without an interface). Details:

1. Name 2. Memory usage 3. Application related to process 4. Files they are accessing 5. Last modified time of files 

I can get a list of running processes in the background, but how do I get the memory usage, the files that they access, and the time the files were last modified. Is it possible to implement this at the API level? Can anyone guide me? How to do it? Can someone give me an idea or suggest a useful link related to this.

+7
source share
2 answers

The Running Services user interface uses getRunningAppProcesses , getProcessMemoryInfo, and getRunningServices .

Please note that this only means that Java processes are controlled by a high-level system; getRunningAppProcesses will not return information about low-level processes of the daemon.

There is information in the kernel about open files under / proc, but you cannot get information about another process unless you use it as root.

Also, all current processes are under / proc, but keep in mind that / proc is not part of the Android SDK, and there is no guarantee that your application will work on all devices or versions of the platform if you use this. / proc is a private implementation.

+9
source

With the following line of code, you can get the current list of running services

 ActivityManager localActivityManager = (ActivityManager) getSystemService(Activity.ACTIVITY_SERVICE); List RunningServiceInfoservices = localActivityManager.getRunningServices(100); 

And from RunningServiceInfo you can get detailed information about the process. http://developer.android.com/reference/android/app/ActivityManager.RunningServiceInfo.html

+4
source

All Articles