Chapter 3

Creating Applications and Activities

What's in this Chapter?

Introducing the Android application components and the different types of applications you can build with them

Understanding the Android application lifecycle

Creating your application manifest

Using external resources to provide dynamic support for locations, languages, and hardware configurations

Implementing and using your own Application class

Creating new Activities

Understanding an Activity's state transitions and lifecycle

To write high-quality applications, it's important to understand the components they consist of and how those components are bound together by the Android manifest. This chapter introduces each of the application components, with special attention paid to Activities.

Next, you'll see why and how you should use external resources and the resource hierarchy to create applications that can be customized and optimized for a variety of devices, countries, and languages.

In Chapter 2, “Getting Started,” you learned that each Android application runs in a separate process, in its own instance of the Dalvik virtual machine. In this chapter, you learn more about the application lifecycle and how the Android run time can manage your application. You are also introduced to the application and Activity states, state transitions, and event handlers. The application's state determines its priority, which, in turn, affects the likelihood of its being terminated when the system requires more resources. ...

Get Professional Android 4 Application Development, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.