Chapter 1

Android Activities

In This Chapter

check1 Launching an activity

check1 Going through an activity’s lifecycle

check1 Getting information from an activity

On a desktop computer, everything starts with a window. Open a window, and run a word processor. Open another window, and read your email. Move a window, minimize a window, resize a window. It’s a very familiar story.

But mobile devices aren’t desktop computers. A smartphone has a relatively small screen, and if by chance you could open several windows at once, the phone’s processor would fall over from exhaustion. On a mobile phone, the “window” metaphor would lead to nothing but trouble.

Tablet devices have larger screens and better processors than their telephone cousins. You can probably squeeze a few windows on a tablet screen, but the power that you would allocate to window-handling could be put to better use.

So where does that leave you? The earliest computers had no windows and no multitasking. You can’t have that. Without some kind of multitasking, “smartphones” wouldn’t be smart.

Android’s first and foremost answer to all windowing questions is the activity. In other chapters, I refer to an activity as “one screenful of components.” ...

Get Android Application Development All-in-One For Dummies, 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.