Explain process hierarchy ?

Foreground process
A process that is required for what the user is currently doing. A process is considered to be in the foreground if any of the following conditions are true:
-It hosts an Activity that the user is interacting with (the Activity's onresume() method has been called).
-It hosts a Service that's bound to the activity that the user is interacting with.
-It hosts a Service that's running "in the foreground"—the service has called startForeground ().
-It hosts a Service that's executing one of its lifecycle callbacks (onCreate(), onStart(), or onDestroy()).
-It hosts a BroadcastReceiver that's executing its onReceive() method.
Generally, only a few foreground processes exist at any given time. They are killed only as a last resort—if memory is so low that they cannot all continue to run
Visible process
A process that doesn't have any foreground components, but still can affect what the user sees on screen.
A process is considered to be visible if either of the following conditions are true:
-It hosts an Activity that is not in the foreground, but is still visible to the user (it’s on Pause () method has been called.
-It hosts a Service that's bound to a visible (or foreground) activity.
A visible process is considered extremely important and will not be killed unless doing so is required to keep all foreground processes running.
Service process
A process that is running a service that has been started with the start Service () method and does not fall into either of the two higher categories. System keeps them running unless there's not enough memory to retain them along with all foreground and visible processes.
Background process
A process holding an activity that's not currently visible to the user (the activity's on Stop () method has been called). System can kill them at any time to reclaim memory for a foreground, visible, or service process.
Empty process
A process that doesn't hold any active application components. The system often kills these processes in order to balance overall system resources between process caches and the underlying kernel caches.

No comments:

Post a Comment