In Android, the applications are run as a separate Linux process. So the application lifecycle is closely related to the process lifecycle. The application process lifecycle is handled by the system depending on the current system memory state.
n case of low memory, the Android system kills some less important process. The process importance is decided depending on the state of the process components.
The process types depending on the importance are as follows
Foreground process: A foreground process is the application process with which the user is currently interacting. The process is considered to be foreground if its Activity is at the top of the Activity stack or its Service is executing callback functions like onCreate(), onStart() or onDestroy() methods.
Visible Process: A visible process is the process which has an Activity visible to the user
Service Process: Service process contains a Service for which startService method is called and the service is running.
Background Process: The background process does not have any visible activities to the user.
Empty Process: Empty process is the one that does not have any active application components. These processes are kept on for caching purpose
It is important that application developers understand lifecycle of the application process. Not using these correctly can result in the system killing the application’s process while it is doing important work.