Book Image

Learning Xamarin studio

By : William Smith
Book Image

Learning Xamarin studio

By: William Smith

Overview of this book

Table of Contents (16 chapters)
Learning Xamarin Studio
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The Android application lifecycle


Most programming paradigms involve a main() method that activates an app and launches it into the memory. In the case of Android, however, the system creates and manages an application object. This object initiates code in an Activity instance by invoking specific callback methods that correspond to specific stages of the Activity's lifecycle. This means that the lifecycle of the application is directly linked to the lifecycle of the foreground Activity.

Understanding application lifecycle

The system creates an application object for each app that's running. This object remains in the memory for the life of the application process, and will always exist in one of the following five possible process statuses at any given time. These statuses are each assigned a priority, which is used exclusively by the system when it needs to determine which processes can be terminated to recover resources:

  • Foreground: Any process that has an Activity in the foreground, which...