Android system starts a new process for the application with a single thread of execution when an application component starts. Different components in your application to run in separate processes and you can create additional threads for any process. android:process attribute that can specify a process in which that component should run. We can set android:process so that components of different applications run in the same process.
Level of Process
There are some level of process.
- Foreground process : Foreground process is focus what is currently doing.when startForeground() method is called then services is started.
- Visible process: Visible process is what the user sees on screen. A visible process is important and will not be killed unless doing so is required to keep all foreground processes running.
- Service process: Service is started when startService() method is called .This service is used handle network transactions, play music, perform file I/O, or interact with a content provider, all running in the background.
- Background process : This process is always running on background but not visible to everyone. when service start background process atomatically.
- Empty process : A Empty process that doesn't hold any active application components. The only reason to keep this kind of process alive is for caching purposes, to improve startup time the next time a component needs to run in it.