I am developing an Android Launcher (Home screen replacement) application and running into the launcher getting killed in low-memory situations. This is obviously not great when the user returns home and has to wait.

In my research, I've found that Android classifies processes into several priority groups, from highest to lowest:

System

Persistent

Foreground

Visible

Perceptible

A Services

Home

Previous

B Services

Background

You can examine what processes fall under which by executing: adb shell dumpsys meminfo

The most comprehensive documentation I could find on this topic was: http://developer.android.com/guide/components/processes-and-threads.html#Lifecycle

However, it does not give a clear picture of all the groups mentioned above. Specifically,

  1. How/when is a process considered "Perceptible"? Some apps (such as the Go Launcher EX), seem to have figured out how to stay in this category when not in foreground. This way, it does not get killed as often. How are they doing it?

    I find from adb shell dumpsys activity that Go Launcher Ex is considered a foreground service. The only documentation I can find on this subject says that you need to put a persistent notification in the status bar. However, Go Launcher Ex somehow got around this requirement. I'm lost as to how:- (

  2. What's the difference between "A Services", "Home", and "B Services"?

  3. Any other general advice for a launcher application on how it can gain higher priority than a regular app? I think this is a completely legitimate request given that a launcher

Edit
Report