Mapping applications to processes

Android applications each run in a single Linux process. Android relies on Linux for process management, and the application itself runs in an instance of the Dalvik virtual machine. The OS may need to unload, or even kill, an application from time to time to accommodate resource allocation demands. There is a hierarchy or sequence the system uses to select the victim of a resource shortage. In general, the rules are as follows:

■ Visible, running activities have top priority.

■ Visible, nonrunning activities are important, because they are recently paused and are likely to be resumed shortly.

■ A running service is next in priority.

■ The most likely candidates for termination are processes that are empty (loaded perhaps for performance-caching purposes) or processes that have dormant Activitys.

It's time to wrap up this chapter with a simple Android application.

Figure 1.7 Applications are listed in the launcher based on their IntentFilter. In this example, the application "Where Do You Live" is available in the LAUNCHER category.

0 0

Post a comment