Datasheet

13
Chapter 1: Developing Spectacular Android Applications
Android Programming Basics
You don’t have to be a member of Mensa to program Android applications.
I’m glad, because otherwise, I wouldn’t be writing them! Programming for
Android is simple because the default programming language of Android is
Java. Although writing Android applications is fairly easy, programming in
itself can be a difficult task to conquer.
If you’ve never programmed before, this book may not be the best place to
start. I advise that you pick up a copy of Beginning Programming with Java For
Dummies, by Barry Burd (Wiley Publishing), to learn the ropes. After you have
a basic understanding of Java under your belt, you should be ready to tackle
this book.
Although the majority of Android is Java, small parts of the framework aren’t.
Android also encompasses the XML language as well as basic Apache Ant
scripting for build processes. I advise you to have a basic understanding of
XML before delving into this book.
If you need an introduction to XML, check out XML For Dummies, by Lucinda
Dykes and Ed Tittel (Wiley).
If you already know Java and XML, congratulations — you’re ahead of
the curve!
Java: Your Android programming language
Android applications are written in Java — not the full-blown Java that J2EE
developers are used to, but a subset of Java that is sometimes known as the
Dalvik virtual machine. This smaller subset of Java excludes classes that
don’t make sense for mobile devices. If you have any experience in Java, you
should be right at home.
It may be a good idea to keep a Java reference book on hand, but in any case,
you can always Google what you don’t understand. Because Java is nothing
new, you can find plenty of examples on the Web that demonstrate how to do
just about anything.
In Java source code, not all libraries are included. Verify that the package is
available to you. If it’s not, an alternative is probably bundled with Android
that can work for your needs.
05_9780470770184-ch01.indd 1305_9780470770184-ch01.indd 13 11/2/10 8:51 AM11/2/10 8:51 AM