Chapter 5. Main Building Blocks

In this chapter, you will learn Android’s capabilities by looking at the big features it offers. We’ll give you a high-level overview of what activities are, how intents work, when and how to use services, how to use broadcast receivers and content providers to make your app scale, and much more.

By “main building blocks,” we refer to the pieces of an application that Android offers you to put together into an Android app. When you start thinking about your application, it is good to take a top-down approach. For instance, most programmers design applications in terms of screens, features, and the interactions between them. You start with a conceptual drawing, something that you can represent in terms of “lines and circles.” This approach to application development helps you see the big picture—how the components fit together and how it all makes sense.

By the end of this chapter, you will understand the main Android components for building applications. You should conceptually know when you’d use what component. You will also see how these components relate to a real-world application.

A Real-World Example

In this book, we’re going to build an app to use Twitter. We know that the user should be able to post status updates. We also know the user should be able to see what her friends are up to. Those are basic features. Beyond that, the user should also be able to update her username and password for the online account. So now we know we should have the ...

Get Learning Android, 2nd 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.