ptg7068951
Creating an Android App 345
Fifteen years later, the Android platform is hosting as many as a billion
Java programs around the world, according to one industry estimate.
Android has the potential to be the most pervasive—and lucrative—area of
Java programming for years to come.
It may also be the most fun.
Creating an Android App
Android apps are ordinary Java programs that use an application frame-
work, a core set of classes and files that all apps have in common. The
framework embodies a set of rules for how apps must be structured in
order to run properly on Android devices.
To get started writing apps, you must install and configure the Android
SDK, the Eclipse IDE, and the Android Plug-in for Eclipse.
If this is your first experience with Android programming, you can find
out how to acquire and set up these tools in Appendix D, “Setting Up an
Android Development Environment.”
Go ahead and do that. I’ll wait for you here and catch up with some
friends on Facebook.
Done? Good.
The first project you undertake is to write a SalutonMondo app, a modest
program that displays a single line of text on the screen of an Android device.
- Run the Eclipse IDE, which looks and acts a lot like NetBeans.
- Choose File, New, Android Project. The New Android Project Wizard
opens, as shown in Figure 24.1. - In the Project Name field, enter SalutonMondo.
- In the Contents section, click Create New Project in Workspace.
- The Use Default Location checkbox determines where the project is
stored. If you’re happy with the default, keep this selected.
Otherwise, deselect the checkbox, click the Browse button, and
choose the folder where the project is stored. - Every Android project requires a build target. The target represents
the oldest version of Android that can run your app. Because each
new Android release has enhanced features, your target choice deter-
mines which features you can use.
CAUTION
This hour is the longest in the
book because there’s a lot to
cover when getting your start as
an Android app developer and
future millionaire. It would have
been split over two hours if my
publisher had not vetoed the
prospective title Sams Teach
Yourself Java in 25 Hours.