What are the different Processes in Android

Posted by : Mitu Sinha
Posted On : 10/15/2013 1:32:31 AM
Posted As :Question Answers
Category :Software Development
View : 443
                 
The following list presents the different types of processes in order of importance (the first process is most important and is killed last): 1. 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. Generally, at that point, the device has reached a memory paging state, so killing some foreground processes is required to keep the user interface responsive. 2. 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 (its onPause() method has been called). This might occur, for example, if the foreground activity started a dialog, which allows the previous activity to be seen behind it. 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. 3.Service process A process that is running a service that has been started with the startService() method and does not fall into either of the two higher categories. Although service processes are not directly tied to anything the user sees, they are generally doing things that the user cares about (such as playing music in the background or downloading data on the network), so the system keeps them running unless there's not enough memory to retain them along with all foreground and visible processes. 4.Background process A process holding an activity that's not currently visible to the user (the activity's onStop() method has been called). These processes have no direct impact on the user experience, and the system can kill them at any time to reclaim memory for a foreground, visible, or service process. Usually there are many background processes running, so they are kept in an LRU (least recently used) list to ensure that the process with the activity that was most recently seen by the user is the last to be killed. If an activity implements its lifecycle methods correctly, and saves its current state, killing its process will not have a visible effect on the user experience, because when the user navigates back to the activity, the activity restores all of its visible state. See the Activities document for information about saving and restoring state. 5.Empty process A 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. The system often kills these processes in order to balance overall system resources between process caches and the underlying kernel caches.
 
when a Project really is Agile
Submitted in: Ask Question | Category: Project Management
what is Data Binding?
Submitted in: Ask Question | Category: Software Development
how to pass data from one activity to another activity?
Submitted in: Ask Question | Category: Software Development
What is Data Annotations ?
Submitted in: Ask Question | Category: Software Development
What is difference between $Scope and $rootScope ?
Submitted in: Ask Question | Category: Software Development
What is difference between TextBox and TextBoxFor?
Submitted in: Ask Question | Category: Software Development
how to send selected data to another page on button click
Submitted in: Ask Question | Category: Software Development
what is attribute routing in asp.net mvc
Submitted in: Ask Question | Category: Software Development
What’s an Object ?
Submitted in: Ask Question | Category: Software Development
What is the Android Architecture?
Submitted in: Ask Question | Category: Software Development
What is difference between account payable and bills payable?
Submitted in: Ask Question | Category: Accounting
What is the diff. between abstract class & interface
Submitted in: Ask Question | Category: Software Developement

All rights reserved to Interviewfunda.com. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. While using this site, you agree to have read and accepted our terms of use and privacy policy. Best viewed at 1024 x 768 resolution with Internet Explorer 5.0 or Mozila Firefox 3.5 or Google Crome and higher