Android life cycle

Source: Internet
Author: User

  1. Unlike the Windows platform, where Android applications cannot control their life cycles, application components must listen to changes in the state of the application and respond appropriately, paying particular attention to being ready to be terminated at any time.

  2. By default, each Android application runs through their own processes, each running in a separate Dalvik instance, and each application's memory and process management is handled exclusively by the runtime. You can use the Android:process property to run the same application component in a different process, or to have multiple applications share a process

  3. When resources are reclaimed, the order in which the processes are terminated is determined by their application priorities, and the priority of an application is equal to the priority of the component with the highest priority.

  4. When two applications have the same priority, the process that runs the longest in the lower-priority state is first terminated. The priority of a process is also affected by inter-process dependencies, and if an application relies on the service or ContentProvider provided by the second application, the second application will at least have the same priority as the application it supports

  5. Active process: The process of an application that has components interacting with the user, including:
      • Active activity, which is in the foreground and responds to user events
      • Executing broadcast Receiver for Onreceiver event handler
      • Executing service for Onstart,oncreate or OnDestroy event handlers
      • Service that is running and has been marked as foreground run

  6. Visible processes: Visible But inactive processes are those that reside "visible activity", for example, when the activity component of a process is partially obscured
  7. Start a service process: a process that has already started, and after the system terminates a running service, it tries to restart the service when the resource is available, unless the system is told not to do so
  8. Background process: The process of activity that is not visible and does not have any running service
  9. Empty processes: To improve overall system performance, Android often keeps them in memory after the end of the application's lifetime, and Android maintains this cache to reduce the start-up time of applications being restarted, which is usually terminated periodically as needed

Android life cycle

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.