Tham khảo tài liệu 'lập trình android (phần 2)', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 26 Chapter 1 Targeting Android The service tag represents a Service. The attributes of the service tag include its class and label. A Service may also include the intent-filter tag. The receiver tag represents a BroadcastReceiver which may or may not have an explicit intent-filter tag. The uses-permission tag tells Android that this application requires certain security privileges. For example if an application requires access to the contacts on a device it requires the following tag in its file uses-permission android name We revisit the file a number of times throughout the book because we need to add more detail for certain elements. Now that you have a basic understanding of the Android application and the file which describes its components it s time to discuss how and where it actually executes. The next section discusses the relationship between an Android application and its Linux and Dalvik virtual machine runtime. 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 Figure 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. 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 .