Understanding the Anatomy of an Android Application
Classical computer science classes often define a program in terms of functionality and data, and Android applications are no different. They perform tasks, display information to the screen, and act upon data from a variety of sources.
Developing Android applications for mobile devices with limited resources requires a thorough understanding of the application lifecycle. Android also uses its own terminology for these application building blocks—terms such as Context, Activity, and Intent. This chapter familiarizes you with the most important components of Android applications.
Mastering Important Android Terminology
This chapter introduces you to the terminology used in Android application development and provides you with a more thorough understanding of how Android applications function and interact with one another. Some of the important terms covered in this chapter are
- Context: The context is the central command center for an Android application. All application-specific functionality can be accessed through the context.
- Activity: An Android application is a collection of tasks, each of which is called an Activity. Each Activity within an application has a unique task or purpose.
- Intent: The Android operating system uses an asynchronous messaging mechanism to match task requests with the appropriate Activity. Each request is packaged as an Intent. You can think of each such request as a message stating an intent to do something.
- Service: Tasks that do not require user interaction can be encapsulated in a service. A service is most useful when the operations are lengthy (offloading time-consuming processing) or need to be done regularly (such as checking a server for new mail).