Building Blocks

A few objects are defined in the Android SDK that every developer needs to be familiar with. The most important ones are activities, fragments, views, intents, services, and content providers. You’ll see examples of most of these in the rest of the book, so I’d like to briefly introduce them now.

Activities

An activity is a user interface screen. Applications can define one or more activities to handle different phases of the program. As discussed in It’s Alive!, each activity is responsible for saving its own state so that it can be restored later as part of the application life cycle. See Creating the Main Screen for an example. Activities extend the Context class, so you can use them to get global information about your ...

Get Hello, Android, 4th 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.