0

Can an Android app kill background services (notifications, services by other apps etc.) to guarantee resources for the app?

I know that Advanced task killer does this. How does it do that and what are the limitations?

If its not possible can OEM provide some special status (e.g. allow it to run with system process priority etc.) to our app which will enable us to guarantee resources for our app?

Help is always appreciated,Thanks

Randroid
  • 3,688
  • 5
  • 30
  • 55

1 Answers1

3

You can register for the permission android.permission.KILL_BACKGROUND_PROCESSES, but you really shouldn't. As an aside, Task Killer apps are actually pretty ineffective because Android usually will recreate those processes and resurrect those background services. Then the Task Killer sees they are running again and kills them. Then Android restarts them... repeat until your battery drains.

As far as guaranteeing resources for your app, quite frankly that's not your responsibility. The Android OS will start terminating background processes as is needed when under memory pressure. If your app is in the foreground, it's highly unlikely for it to be killed.

In summary, let Android handle memory management across the OS. Your job should only be to use the memory it gives to your process as efficiently as you can.

Karakuri
  • 38,365
  • 12
  • 84
  • 104