Home > Tricks & Tips > Do TaskManager apps really kill other apps immediately?

Do TaskManager apps really kill other apps immediately?

It’s the question that I was wondering for while “How to kill other running processes?”.

I’ve found some methods to proceed this action.

1. Use Process to kill : android.os.Process.killProcess()

This is what it is said in documentation:

Kill the process with the given PID. Note that, though this API allows us to request to kill any process based on its PID, the kernel will still impose standard restrictions on which PIDs you are actually able to kill. Typically this means only the process running the caller's packages/application and any additional processes created by that app; packages sharing a common UID will also be able to kill each other's processes.

So basically, it means that it cannot kill other processes unless they share the same UID.

> Epic Failed!


2. Use Process to send SIGNAL: android.os.Process.sendSignal()

Look at this page on signal and kill

So it means the TaskKiller-like apps should have privileges or appropriate permission on other process in order to kill, otherwise, it must depend on system to decide when to kill.

> Epic Failed!

3. Use ActivityManger to kill: android.app.killBackgroundProcesses()

Have the system immediately kill all background processes associated with the given package. This is the same as the kernel killing those processes to reclaim memory; the system will take care of restarting these processes in the future as needed.

Above is what the docs say about it.

However, does it really kill the give package immediately? I’ve tried but fail. It really depends on system to kill.

> Epic Failed! Or Not?


4. Use ActivityManager to kill: android.app.ActivityManager.restartPackage()

– It’s deprecated now, nevermind about this!


So if TaskKiller-like apps cannot kill other running processes immediately, then what does it do because users might feel like it really works right away?

– One thing might be that the TaskKiller-like apps send the signal or whatever killing like above, then displaying on screen list of running process not in SUSPENDED state, just hide from users. It could be an answer, there might be others as well but I cannot think of.

There are some references on StackOverflow talking about this matter:

How do Task Manager’s kill apps?

How to kill currently running task in android?

Android: kill processes and close applications

Android process killer

Feel free to share if you got any idea.



Pete Houston


Categories: Tricks & Tips Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: