The Android operating system now powers 32 percent of the smartphones in the United States. Android has not only a plurality of users but also a well-designed Java-based SDK to make developing apps straightforward and fun. With that, welcome to Android 3 SDK Programming For Dummies!
This book explains the workings of the latest version of the Android SDK (version 3.1 when this book was printed). The book is aimed at the following audiences of software developers:
This book explains to you how to build exciting, engaging Android apps. You can find out how to make high-quality apps that are fit for the enterprise or the consumer market because they perform well, are bug-free, and behave well even under stressful situations (such as when network failure occurs or a device runs out of power). We include a chapter that describes how to make the app available on the Android Market (see Chapter 13) and by way of other avenues so that you can make your app available to the masses.
High quality cannot be achieved without proper design. We therefore devote a chapter to the proper design of object-oriented Android applications built on the Android framework (see Chapters 7, 8, and 9). We also include a chapter that tells you how to make the best use of the Android SDK within the Eclipse integrated development environment, or IDE (see Chapter 12), with a heavy emphasis on the unit-testing framework provided by the SDK and integrated into Eclipse.
To put the explanations of the SDK in context, we provide, and use, a complete working example built around a Tic-Tac-Toe game application.
No For Dummies book would be complete without “The Part of Tens,” so we close this book with two of these chapters (Chapters 14 and 15): The first lists Android resources, and the second lists what we believe are ten of the top Android applications now on the market.
Throughout this book, we use our own extensive development experience to distill the extensive Android documentation available on the web into a form that's necessary in order to understand the SDK. However, this book certainly isn't a replacement for the SDK documentation. We try, as much as possible, therefore, to cover the essential areas and then point you to the web for additional details.
This book guides you through a discussion of the Android SDK and shows you how to build high-quality applications by using it. The conventions we use in the book are described in this list:
public void onClick(View v){…}
The source code for the Tic-Tac-Toe example is on this book's companion website, at www.dummies.com/go/android3sdkprogramming. From time to time, we provide updates to the code and post other material that you might find useful.
http://en.wikipedia.org/wiki/Tictactoe
The common denominator for anyone reading this book is an interest in developing high-quality apps for Android. One thing you'll already need to have is a good knowledge of Java — because we don't explain how to use it. If you don't know how to use Java, we recommend the introductory Java For Dummies, 5th Edition, by Barry Burd, and Java All-in-One For Dummies, 3rd Edition, by Doug Lowe. We also assume that you have used at least one IDE to develop software, and, ideally, Eclipse. Though we cover some basic Eclipse information (see Chapter 12), we focus on how to use the Android-specific capabilities within Eclipse (available via the add-on ADT Plug-in For Eclipse).
This book is divided into several parts, to help you conveniently find the information you need.
This part of the book talks about getting set up to develop programs using the Android SDK. Chapter 1 is an overview of the unique needs and capabilities of mobile applications and the Android framework — its components and its application model. Chapter 2 gets you started using the Eclipse IDE and its Android extensions via the Tic-Tac-Toe sample application. Chapter 3 also uses the Tic-Tac-Toe sample application to introduce you to the components of the Android Application Model; if you read only one chapter in this book, this chapter is the one we suggest.
Part II builds on Part I by showing you the elements you need in order to design and build the core of your application. Chapter 4 tells you how to choose the correct SDK level, Chapters 5 and 6 address user interface components in depth, and Chapter 7 shows you how to properly design an Android application using object-oriented design techniques and how to fit the basic design into the Android framework.
Though Part II talks about building the right application, Part III tells you all about building the app right. Chapter 8 helps you make your app fast and responsive (which, by the way, aren't the same qualities, as you will see), and Chapter 9 talks about security. Without speed, responsiveness, and security, your app won't be successful when it's released, however cool its features might be.
Part IV is all about which SDK components may be used to add advanced capabilities to your app. Thus, Chapter 10 covers integrating the web and location services into your app. Chapter 11 covers using audio, video, and (most importantly) sensors.
In Part V, we discuss Eclipse again (in Chapter 12) to cover in more detail the Android add-ons to Eclipse. In particular, we describe the unit testing and performance optimization capabilities that Eclipse on Android gives you. Chapter 13 focuses on the endgame: After you develop your app, you presumably want to make it commercially available.
No For Dummies book is complete without “The Part of Tens.” Chapter 14 covers the top ten developer resources on the web, and Chapter 15 describes the best of the Android applications, not so much to advertise them as to give you examples of how these cool apps (and they are cool) leverage the Android SDK.
Little pictures in the margin of tech books help you find certain types of information such as tips or warnings quickly. Here are the ones you should look for in this book:
Tips are like little advice columns that provide advice about the current topic or other great things you can do to push your Android 3 SDK programming experience to the next level.
Remember icons signal either a pertinent fact that relates to what you're reading at the time (but is also mentioned elsewhere in the book) or a reiteration of a particularly important piece of information that's, well, worth repeating.
Warning icons alert you to potential pitfalls, so don't ignore them.
This icon marks information that goes beyond the basics.
You can read Android 3 SDK Programming For Dummies in either of two ways:
18.118.198.83