What’s in This Book?
Chapter 1 takes you through the steps of setting up the Android development envi‐ ronment and building several simple applications of the well-known “Hello, World” type pioneered by Brian Kernighan.
Chapter 2 covers some of the differences in mobile computing that will hit developers coming from desktop and enterprise software environments, and talks about how mobile design (in particular, Android design) differs from those other environments.
Testing is often an afterthought for some developers, so we discuss this early on, in Chapter 3. Not so that you’ll skip it, but so that you’ll read and heed. We talk about unit testing individual components as well as testing out your entire application in a well-controlled way.
Android provides a variety of mechanisms for communicating within and across applications. In Chapter 4 we discuss Intents and broadcast receivers, Services, AsyncTasks, and handlers.
Chapter 5 covers a range of topics related to graphics, including use of the graphical drawing and compositing facilities in Android as well as using desktop tools to develop graphical images, textures, icons, and so on that will be incorporated into your finished application.
Every mobile app needs a GUI, so Chapter 6 covers the main ins and outs of GUI development for Android. Examples are given both in XML and, in a few cases, in Java-coded GUI development.
Chapter 7 covers all the pop-up mechanisms—menus, dialogs, and toasts—and one that doesn’t pop up but is also for interaction outside your application’s window, Android’s notification mechanism.
Lists of items are very common in mobile applications on all platforms. Chapter 8 focuses on the “list” components in Android: the ListView and its newer replacement, the RecyclerView.
Android is rich in multimedia capabilities. Chapter 9 shows how to use the most important of these.
Chapter 10 shows how to save data into files, databases, and so on—and how to retrieve it later, of course. Another communication mechanism is about allowing controlled access to data that is usually in a SQL database. This chapter also shows you how to make application data available to other applications through something as simple but ubiquitous (in Android) as the URL, and how to use various cloud- based services to store data.
Android started out as an operating system for mobile telephones. Chapter 11 shows how to control and react to the telephony component that is in most mobile devices nowadays.
Mobile devices are, for the most part, always-on and always-connected. This has a major impact on how people use them and think about them. Chapter 12 shows the coding for traditional networked applications. This is followed by Chapter 13, which discusses gaming and animation, and Chapter 14, which discusses social networking.
The now-ubiquitous Global Positioning System (GPS) has also had a major impact on how mobile applications work. Chapter 15 discusses how to find a device’s loca‐ tion, how to get map data from Google and OpenStreetMap, and how applications can be location-aware in ways that are just now being explored.
Chapter 16 talks about the sensors built into most Android devices and how to use them.
Chapter 17 talks about the low-energy very-local area networking that Bluetooth ena‐ bles, going beyond connecting your Bluetooth headset to your phone.
Android devices are perhaps unique in how much control they give the developer. Some of these angles are explored in Chapter 18. Because Android is Linux-based, a few of the recipes in this chapter deal with traditional Unix/Linux commands and facilities.
In Chapter 19, we explore the use of other programming languages to write all or part of your Android application. Examples include C, Perl, Python, Lisp, and other lan‐ guages.
While this edition of this book is in English, and English remains the number-one technical language worldwide, it is far from the only one. Most end users would rather have an application that has its text in their language and its icons in a form that is culturally correct for them. Chapter 20 goes over the issues of language and culture and how they relate to Android.
Finally, most Android developers hope other people will use their applications. But this won’t happen if users can’t find the applications. Chapter 21 shows how to pre‐ pare your application for distribution via the Google Play Store, and to use that as well as other markets to get your application out to the people who will use it.