O'Reilly logo

Android Application Development by G. Blake Meike, Zigurd Mednieks, John Lombardo, Rick Rogers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hello, Android

So enough downloading; let’s write a program. A “Hello World!” program is traditional, and we will start with something similar to demonstrate what you need to do to create, build, and test an Android application. We won’t explore much of the Android API for this program—that’s left for the following chapters—but here we’ll get a taste for the development environment and the steps you go through to create an application for Android.

Where We’re Going

There isn’t much functionality in this program. We just want to display some text on the Android emulator window that says “Hello Android!” (see Figure 2-1).

“Hello Android” screenshot

Figure 2-1. “Hello Android” screenshot

Starting a New Android Application: HelloWorld

Several components are needed to build an Android application. Fortunately, the Eclipse IDE with the Android plug-in automates a lot of the work needed to create and maintain these components. We will start by using the IDE to create a project for our application. Start up Eclipse and select “File → New → Project...” from the menu bar (be sure to select “Project...”, not “Java Project”). You’ll see a list of project types, similar to the menu in Figure 2-2.

Eclipse New Project menu

Figure 2-2. Eclipse New Project menu

Select “Android Project” and click “Next” to get the “New Android Project” dialog box (Figure 2-3 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required