Android for Programmers: An App-Driven Approach / Edition 1

Paperback (Print)
Rent from
(Save 75%)
Est. Return Date: 07/26/2015
Buy Used
Buy Used from
(Save 41%)
Item is in good condition but packaging may have signs of shelf wear/aging or torn packaging.
Condition: Used – Good details
Used and New from Other Sellers
Used and New from Other Sellers
from $1.99
Usually ships in 1-2 business days
(Save 96%)
Other sellers (Paperback)
  • All (9) from $1.99   
  • New (3) from $31.62   
  • Used (6) from $1.99   


The professional programmer’s Deitel® guide to Android™ smartphone and tablet app development and the Eclipse IDE with the Android Development Tools (ADT) plug-in

Billions of apps have been downloaded from Android Market! This book gives you everything you’ll need to start developing great Android apps quickly and getting them published on Android Market. The book uses an app-driven approach—each new technology is discussed in the context of 16 fully tested Android apps, complete with syntax coloring, code walkthroughs and sample outputs. Apps you’ll develop include:

  • SpotOn Game
  • Slideshow
  • Flag Quiz
  • Route Tracker
  • Favorite Twitter® Searches
  • Address Book
  • Tip Calculator
  • Doodlz
  • Weather Viewer
  • Cannon Game
  • Voice Recorder
  • Pizza Ordering

Practical, example-rich coverage of:

  • Smartphone and Tablet Apps, Android Development Tools (ADT) Plug-In for Eclipse
  • Activities, Intents, Content Providers
  • GUI Components, Menus, Toasts, Resource Files, Touch and Gesture Processing
  • Tablet Apps, ActionBar and AppWidgets
  • Tweened Animations, Property Animations
  • Camera, Audio, Video, Graphics, OpenGL ES
  • Gallery and Media Library Access
  • SharedPreferences, Serialization, SQLite
  • Handlers and Multithreading, Games
  • Google Maps, GPS, Location Services, Sensors
  • Internet-Enabled Apps, Web Services, Telephony, Bluetooth®
  • Speech Synthesis and Recognition
  • Android Market, Pricing, Monetization
  • And more…

PLUS: Register your product at for additional online chapters that cover Android Ice Cream Sandwich (Android 4), including a complete, working Ice Cream Sandwich app!


  • For information on Deitel’s Dive Into® Series instructor-led programming language training courses offered at customer sites worldwide visit or write to
  • Download code examples
  • Check out the growing list of programming Resource Centers
  • Join the Deitel Twitter (@deitel) and Facebook ( communities
  • To receive updates for this book, subscribe to the free Deitel ® Buzz Online e-mail newsletter at
Read More Show Less

Editorial Reviews

From the Publisher

“I really love what you’re doing with the book. It has the potential to become the best Android book on themarket. It’s impressive to see so many well-explained useful examples of Android patterns. The coverage of recent Honeycomb-specific APIs such as ViewPropertyAnimator and resizeable AppWidgets makes this work especially current.”

—Dan Galpin, Android Advocate and author of Intro to Android Application Development

“I really like that this is aiming to stay up-to-date with Android 3 and be the most current book possible by covering key Android 3 features such as property animation, fragments, the ActionBar, tabbed navigation and more. I haven’t seen any other books cover app publishing so well and the links provided throughout are an impressive collection that I think would be valuable to anyone getting started. You get full applications that show multiple parts of the APIs working together. I wish this book had been around when I started developing on Android.”

—Douglas Jones, Senior Software Engineer, Fullpower Technologies

“This is the book for developers interested in starting Android application development. While the target of Android for Programmers is people with some development experience, even novices will find this book an interesting read and it will speed their immersion into Android development. The book starts by describing the Android development environment. Then each chapter introduces a core aspect of the Android platform by briefly explaining the topic, then illustrating the capability with working code. The sample apps demonstrate the topics of each chapter, which easily can be applied to your own projects. By far, this is the quickest way to get comfortable writing applications for the #1 smartphone operating system. I really enjoy the book.”

—Eric J. Bowden, COO, Safe Driving Systems, LLC

“Takes the ideal approach of teaching you the Android SDK through actual use. Rather than regurgitate the API documentation, this book shows you how to write an app in every chapter, explaining each aspect of the SDK as it’s encountered. Some apps are built from scratch; others expand on the apps in previous chapters, iterating on the code to implement new functionality. The full source code is available, so you can see how the SDK is really used. Teaches you all the Android essentials from layouts to sensors and even on to features added in Honeycomb such as property animation, tabbed navigation with the ActionBar, fragments and web services with JsonReader. Whether you’ve never touched Android or you have some apps under your belt already, this book is definitely worth picking up.”

—Ian G. Clifton, Independent Contractor and Android App Developer

“With the increasing scope of Android, getting up to speed can be a challenge. This book addresses a compelling set of topics, presenting them in self-contained packages that are fun and instructive. The coverage of key Android 3 features such as fragments, resizable App Widgets and the Action Bar is interesting. For tablet-oriented app development, familiarity with these tools is essential. Creates UI/layouts with a depth of detail I’ve not seen elsewhere.”

—Sebastian Nykopp, Chief Architect, Reaktor

“The Welcome app looks solid; great to see the integration of the new layout editor. The Tip Calculator app is a pretty cool example and definitely a useful app; I love the deeper coverage of the lifecycle. The Favorite Twitter Searches app is a good way to demonstrate ScrollView. The Flag Quiz app is one of my favorites, covering delayed events, View animations and string arrays; I like the use of the AssetManager for the flags. The XML declaration and explanation of the tweened flag-shake animation is nicely done. The SpotOn Game app is one of my favorites; it does an excellent job in covering the new Honeycomb+ property animations, and uses them in a creative way to build a surprisingly fun little game. Nice job of keeping the database queries out of the UI thread in the Address Book app. It’s great how the Route Tracker app chapter puts so much useful MapView information in one place. Slideshow is a beautiful app.”

—Dan Galpin, Android Advocate and author of Intro to Android Application Development

“The Welcome app does a great job illustrating the Visual Layout Editor; I liked the approach of building visual components without code; this makes it easy to experiment with other properties to customize the look of the app. There’s a lot of time spent on the Tip Calculator app UI in the Visual Layout Editor—the line-by-line explanations of the code are extremely valuable; this is a solid introduction to how Android works. Favorite Twitter Searches taught me things I didn’t know. The Flag Quiz app is a great chapter; clearly written, and I particularly appreciated the completeness of the code comments. The Cannon Game app is a nice introduction to animation. The SpotOn Game app did a great job introducing Android 3+; in a lot of ways, Google has separated Android 2.x and 3.x by intended use (i.e. phone vs. tablet); this chapter introduces some of those concepts and helps the software developer understand some of the SDK differences. The Doodlz app chapter uses great examples to illustrate the concepts. The Address Book app is a good introduction to SQLite databases. The introduction to the camera in the Enhanced Slideshow app chapter is valuable information.”

—Eric J. Bowden, COO, Safe Driving Systems, LLC

“The Intro chapter gives a solid overview of Android. The Welcome app chapter is a nice intro to layouts, keeping it simple, while still using a common layout (RelativeLayout) and explaining the resulting XML. Favorite Twitter Searches app is a great chapter that introduces a lot of new (core) concepts. The app descriptions give a clear understanding of what is being built and the technologies overviews are particularly nice; the colored highlighting is helpful. The SpotOn Game app is a great intro to 3.x animation and produces a fun game without a lot of code. Doodlz is a great app—anyone can identify with it and it gives readers a chance to learn about Android. The Address Book app is a good intro to some key aspects of Android programs (in particular, launching other Activities and utilizing a SQLite database). The Route Tracker app chapter is excellent.”

—Ian G. Clifton, Independent Contractor and Android App Developer

“One of the most comprehensive intro chapters I have read, especially the number and variety of links to outside sources. I like the Welcome app as a way to get the reader’s feet wet; it breaks them into Eclipse and it gets them making something without Java code. TheTip Calculator app UI highlights the tricky cases of TableLayout and TableRow. The Favorite Twitter Searches app does a good job of introducing important UI skills, especially using the LayoutInflater and the ScrollView to programmatically add UI elements. The Flag Quiz app chapter does a good job of showing a variety of tools, such as collections, DialogBuilder options and animations; the method used to handle all the data is a good one. Those property animators sure make the SpotOn Game app code straightforward; well done. The Route Tracker is a solid example of a location and map app. The Slideshow app reinforces list handling and adapters. I like the intro to serialization in the Enhanced Slideshow app.”

—Douglas Jones, Senior Software Engineer, Fullpower Technologies

“Good intro to overall Android, Java and OO concepts.”

—Ronan “Zero” Schwarz (CIO, OpenIntents)

“A good intro to Android platform capabilities and online resources for getting into Android development; a valuable timesaver, particularly with the increasing amount of available Android information; the walkthrough for getting an app running in the emulator is easy to follow. The Flag Quiz app chapter is easy to follow and quite enjoyable; clear description of key UI elements; good that the distinction between assets/ and res/ is presented; nice that View animation is included in an example relevant to the app (adds a professional touch); the yellow code highlighting works well. The Address Book app chapter is a good introduction to CRUD [create, read, update and delete] apps. The Route Tracker app chapter is an easy introduction to location tracking. The Enhanced Slideshow app is a straightforward demonstration on how to use the camera and display video in an application.”

—Sebastian Nykopp, Chief Architect, Reaktor

Read More Show Less

Product Details

  • ISBN-13: 9780132121361
  • Publisher: Prentice Hall
  • Publication date: 11/7/2011
  • Series: Deitel Developer Series
  • Edition number: 1
  • Pages: 512
  • Sales rank: 984,355
  • Product dimensions: 7.00 (w) x 9.00 (h) x 1.20 (d)

Meet the Author

Paul Deitel, Abbey Deitel and Harvey Deitel are from Deitel & Associates, Inc., the internationally recognized programming languages authoring and corporate-training organization. Over a million people worldwide have used Deitel books to master Java™, iPhone app development, C#, C++, C, Internet and web programming, JavaScript, XML, Visual Basic®, Visual C++®, Perl, Python and more. Michael Morgano is a professional Android developer with Imerj.
Read More Show Less

Table of Contents

Preface xiv

Before You Begin xxii

Chapter 1: Introduction to Android 1

1.1 Introduction 2

1.2 Android Overview 4

1.3 Android 2.2 (Froyo) 7

1.4 Android 2.3 (Gingerbread) 10

1.5 Android 3.0 (Honeycomb) 12

1.6 Android Ice Cream Sandwich 15

1.7 Downloading Apps from the Android Market 16

1.8 Packages 17

1.9 Android Software Development Kit (SDK) 18

1.10 Object Technology: A Quick Refresher 20

1.11 Test-Driving the Doodlz App in an Android Virtual Device (AVD) 23

1.12 Deitel Resources 32

1.13 Android Development Resources 33

1.14 Wrap-Up 34

Chapter 2: Android Market and App Business Issues 35

2.1 Introduction 36

2.2 Building Great Android Apps 36

2.3 Android Best Practices 38

2.4 Registering at Android Market 44

2.5 Setting Up a Google Checkout Merchant Account 44

2.6 AndroidManifest.xml File 45

2.7 Preparing Your Apps for Publication 46

2.8 Uploading Your Apps to Android Market 51

2.9 Other Android App Marketplaces 54

2.10 Pricing Your App: Free or Fee 54

2.11 Monetizing Apps with In-App Advertising 56

2.12 Monetizing Apps: Using In-App Billing to Sell Virtual Goods in Your Apps 57

2.13 Launching the Market App from Within Your App 59

2.14 Managing Your Apps in Android Market 59

2.15 Marketing Your App 59

2.16 Other Popular App Platforms 64

2.17 Android Developer Documentation 65

2.18 Android Humor 66

2.19 Wrap-Up 67

Chapter 3: Welcome App 68

Dive-Into® Eclipse and the ADT Plugin

3.1 Introduction 69

3.2 Technologies Overview 69

3.3 Eclipse IDE 70

3.4 Creating a New Project 71

3.5 Building the Welcome App’s GUI with the ADT’s Visual Layout Editor 74

3.6 Examining the main.xml File 87

3.7 Running the Welcome App 89

3.8 Wrap-Up 89

Chapter 4: Tip Calculator App 91

Building an Android App with Java

4.1 Introduction 92

4.2 Test-Driving the Tip Calculator App 93

4.3 Technologies Overview 94

4.4 Building the App’s GUI 94

4.5 Adding Functionality to the App 106

4.6 Wrap-Up 116

Chapter 5: Favorite Twitter® Searches App 117

SharedPreferences, Buttons, Nested Layouts, Intents, AlertDialogs, Inflating XML Layouts and the Manifest File

5.1 Introduction 118

5.2 Test-Driving the Favorite Twitter Searches App 119

5.3 Technologies Overview 121

5.4 Building the App’s GUI and Resource Files 123

5.5 Building the App 131

5.6 AndroidManifest.xml 142

5.7 Wrap-Up 143

Chapter 6: Flag Quiz Game App 146

Assets, AssetManager, Tweened Animations, Handler, Menus and Logging Error Messages

6.1 Introduction 147

6.2 Test-Driving the Flag Quiz Game App 151

6.3 Technologies Overview 151

6.4 Building the App’s GUI and Resource Files 153

6.5 Building the App 160

6.6 AndroidManifest.xml 174

6.7 Wrap-Up 175

Chapter 7: Cannon Game App 176

Listening for Touches and Gestures, Manual Frame-By-Frame Animation, Graphics, Sound, Threading, SurfaceView and SurfaceHolder

7.1 Introduction 177

7.2 Test-Driving the Cannon Game App 178

7.3 Technologies Overview 179

7.4 Building the App’s GUI and Resource Files 181

7.5 Building the App 183

7.6 Wrap-Up 203

Chapter 8: SpotOn Game App 204

Property Animation, ViewPropertyAnimator, AnimatorListener, Thread-Safe Collections, Default SharedPreferences for an Activity

8.1 Introduction 205

8.2 Test-Driving the SpotOn Game App 206

8.3 Technologies Overview 207

8.4 Building the App’s GUI and Resource Files 208

8.5 Building the App 210

8.6 Wrap-Up 224

Chapter 9: Doodlz App 225

Two-Dimensional Graphics, SensorManager, Multitouch Events and Toasts

9.1 Introduction 226

9.2 Test-Driving the Doodlz App 227

9.3 Technologies Overview 228

9.4 Building the App’s GUI and Resource Files 229

9.5 Building the App 234

9.6 Wrap-Up 256

Chapter 10: Address Book App 258

ListActivity, AdapterViews, Adapters, Multiple Activities, SQLite, GUI Styles, Menu Resources and MenuInflater

10.1 Introduction 259

10.2 Test-Driving the Address Book App 261

10.3 Technologies Overview 262

10.4 Building the GUI and Resource Files 263

10.5 Building the App 269

10.6Wrap-Up 290

Chapter 11: Route Tracker App 291

Google Maps API, GPS, LocationManager, MapActivity, MapView and Overlay

11.1 Introduction 292

11.2 Test-Driving the Route Tracker App 294

11.3 Technologies Overview 296

11.4 Building the GUI and Resource Files 298

11.5 Building the App 300

11.6 Wrap-Up 318

Chapter 12: Slideshow App 319

Gallery and Media Library Access, Built-In Content Providers, MediaPlayer, Image Transitions, Custom ListActivity Layouts and the View-Holder Pattern

12.1 Introduction 320

12.2 Test-Driving the Slideshow App 323

12.3 Technologies Overview 324

12.4 Building the GUI and Resource Files 327

12.5 Building the App 331

12.6 Wrap-Up 358

Chapter 13: Enhanced Slideshow App 360

Serializing Data, Taking Pictures with the Camera and Playing Video in a VideoView

13.1 Introduction 361

13.2 Test-Driving the Enhanced Slideshow App 362

13.3 Technologies Overview 363

13.4 Building the GUI and Resource Files 364

13.5 Building the App 367

13.6 Wrap-Up 389

Chapter 14: Weather Viewer App 390

Web Services, JSON, Fragment, ListFragment, DialogFragment, ActionBar, Tabbed Navigation, App Widgets, Broadcast Intents and BroadcastReceivers

14.1 Introduction 391

14.2 Test-Driving the Weather App 393

14.3 Technologies Overview 394

14.4 Building the App’s GUI and Resource Files 396

14.5 Building the App 399

14.6 Wrap-Up 459

Index 460

Chapters on the Web

Go to the book’s registration page to register and download these chapters.

Chapter 15: PHAB’s Pizza App

Text-to-Speech, Speech-to-Text and Telephony

Chapter 16: Voice Recorder App

Audio Recording and Playback

Chapter 17: Enhanced Address Book App


Chapter 18: 3D Art App

OpenGL ES 3D Rendering

Chapter 19: HTML5 Favorite Twitter® Searches App

Bonus Chapter: HTML5, CSS3 and JavaScript for Experienced Web Developers

Read More Show Less

Customer Reviews

Average Rating 3.5
( 5 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 6 Customer Reviews
  • Posted December 5, 2011

    Very useful colorful and well organized, A keeper.

    I initially selected this book due to the multiple authors, hoping it would be more error free than other book I have read from single authors. So far that has been true, the more eyes in the review process really help not only catch errors but organize the material. Little things like all code snippets having line numbers and being high-lighted to follow the text really help. There are a good number of screen shots that make it easy to follow along with Eclipse on a windows or mac machine. I read so many posts on the internet saying Android has no GUI builder to layout widgets, and was very surprised, it wasn't until this book, I found out they are wrong. Adroid being what it is with Google behind it needs all the help with documentation and organization it can get. Google has that tendency to just leave it as-is, while their phD's make more hard to follow videos. The 16 apps they use as examples cover a nice range of UI, Services and libraries. The only negative is I'd prefer to not use Eclipse and would rather use my editor and a make file, but this isn't the authors faults, Android seems to be married to the ADT visual layout editor plugin and the ant build system. This book is for the rest of us that are normal C++ or C# or Java folks and can talk layman terms in getting the job done. The authors are to be commended for that alone!

    3 out of 3 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted April 29, 2012

    This title cannot be viewed on this device

    Motorola xoom

    0 out of 2 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
  • Posted January 13, 2012

    Not what you think!

    This book is basically a list of URLs and a rehash of the Android documentation. Makes me wonder if all Deitel materials are like this one.

    0 out of 1 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted December 28, 2011

    No text was provided for this review.

  • Anonymous

    Posted May 30, 2012

    No text was provided for this review.

  • Anonymous

    Posted April 1, 2012

    No text was provided for this review.

Sort by: Showing all of 6 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)