user3292727
user3292727

Reputation: 1

PID of all running processes on android

I need to get process ID's of all the running processes in android as a part of my code. which is the most efficient way of doing it?is there an API for it?

Upvotes: 0

Views: 1617

Answers (2)

Himanshu Joshi
Himanshu Joshi

Reputation: 3399

You Can PID's By following code

RunningAppProcessInfo service[]= manager.getRunningAppProcesses();
String pid = service.pid;

Upvotes: 1

user3291365
user3291365

Reputation: 455

I think you'd need to use ActivityManager for the process info. You could:

  1. Get all running app processes.
  2. Find your app.
  3. Get its PID.

Upvotes: 0

Related Questions