Introduction

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!

About This Book

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:

  • You have experience in developing other kinds of Java applications but not those for a mobile device. If this is you, don't worry — this book serves as a mobile applications primer and discusses resource conservation, network disconnection, location changes, and hardware-software interaction, for example.
  • You have mobile application development experience and are looking to develop an Android application equivalent to an app on another platform (such as the iPhone). You will be able to quickly understand the Android programming model (which is similar to, but also different from, the iOS and BlackBerry models) and then navigate to the chapters in the book that you're most interested in.
  • You have Android experience and are looking to upgrade a program written for an earlier version of Android. You can easily identify the changed or new capabilities in the various versions of the Android SDK. If you're looking to identify what additional application functions or user experiences can be provided in a new release, this book helps you in that area as well.

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.

Conventions Used in This Book

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:

  • Code examples appear in monofont so that they stand out better. The code you see looks like this:
    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.

  • URLs appear in monofont, like this:
    http://en.wikipedia.org/wiki/Tictactoe
  • Sidebars provide you with background information about certain topics. This information can be helpful, but you don't have to read it to be able to understand the topic.
  • Chapters that delve into the specific capabilities of the SDK are organized into two broad parts (each consisting of several sections):
    • The “how-to” section describes various capabilities and provides examples.
    • The section titled “Understanding the SDK Components Used in This Chapter” describes in greater detail key classes from the SDK and provides links to detailed information about these classes available in the Android documentation on the web.

Foolish Assumptions

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).

How This Book Is Organized

This book is divided into several parts, to help you conveniently find the information you need.

Part I: Getting the Android SDK to Work

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: Building the Core of an Android Application

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.

Part III: Making Your Applications Fit for the Enterprise

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: Enhancing the Capabilities of Your Android Application

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.

Part V: Effectively Developing, Testing, and Publishing Apps

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.

Part VI: The Part of Tens

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.

Icons Used in This Book

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:

image 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.

image 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.

image Warning icons alert you to potential pitfalls, so don't ignore them.

image This icon marks information that goes beyond the basics.

Where to Go from Here

You can read Android 3 SDK Programming For Dummies in either of two ways:

  • Read the chapters in sequential order, from cover to cover. If this book is your first real exposure to Android SDK terminology, concepts, and technology, this method is probably the way to go.
  • Read selected chapters or sections of particular interest to you in any order you choose. The chapters have been written to stand on their own as much as possible.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.198.83