Welcome to the Warescription!
We hope you enjoy this ebook and its updates subscribe to the Warescription newsletter on the Warescription site to learn when new editions of this book, or other books, are available.
All editions of CommonsWare titles, print and ebook, follow a software-style numbering system. Major releases (1.0, 2.0, etc.) are available in both print and ebook; minor releases (0.1, 0.9, etc.) are available in ebook form for Warescription subscribers only. Releases ending in .9 are "release candidates" for the next major release, lacking perhaps an index but otherwise being complete.
Each Warescription ebook is licensed for the exclusive use of its subscriber and is tagged with the subscriber's name. We ask that you not distribute these books. If you work for a firm and wish to have several employees have access, enterprise Warescriptions are available. Just contact us at .
Also, bear in mind that eventually this edition of this title will be released under a Creative Commons license more on this in the .
Remember that the CommonsWare Web site has errata and resources (e.g., source code) for each of our titles. Just visit the Web page for the book you are interested in and follow the links.
You can search through the PDF using most PDF readers (e.g., Adobe Reader). If you wish to search all of the CommonsWare books at once, and your operating system does not support that directly, you can always combine the PDFs into one, using tools like PDF Split-And-Merge or the Linux command pdftk *.pdf cat output combined.pdf
.
Preface
Welcome to the Book!
If you come to this book after having read its companion volumes, The Busy Coder's Guide to Android Development and The Busy Coder's Guide to Advanced Android Development, thanks for sticking with the series! CommonsWare aims to have the most comprehensive set of Android development resources (outside of the Open Handset Alliance itself), and we appreciate your interest.
If you come to this book having learned about Android from other sources, thanks for joining the CommonsWare community!
Prerequisites
This book is a collection of tutorials, walking you through developing Android applications, from the simplest "Hello, world!" to applications using many advanced Android APIs.
Since this book only supplies tutorials, you will want something beyond it as a reference guide. That could be simply the Android SDK documentation, available with your SDK installation or online. It could be the other books in the CommonsWare Android series. Or, it could be another Android book a list of currently-available Android books can be found on the Android Programming knol. What you do not want to do is attempt to learn all of Android solely from these tutorials, as they will demonstrate the breadth of the Android API but not its depth.
Also, the tutorials themselves have varying depth. Early on, there is more "hand-holding" to explain every bit of what needs to be done (e.g., classes to import). As the tutorials progress, some of the simpler Java bookkeeping steps are left out of the instructions such as exhaustive lists of import statements so the tutorials can focus on the Android aspects of the code.
You can find out when new releases of this book are available via:
- The cw-android Google Group, which is also a great place to ask questions about the book and its examples
- The commonsguy Twitter feed
- The CommonsBlog
- The Warescription newsletter, which you can subscribe to off of your Warescription page
Using the Tutorials
Each tutorial has a main set of step-by-step instructions, plus an "Extra Credit" section. The step-by-step instructions are intended to guide you through creating or extending Android applications, including all code you need to enter and all commands you need to run. The "Extra Credit" sections, on the other hand, provide some suggested areas for experimentation beyond the base tutorial, without step-by-step instructions.
If you wish to start somewhere in the middle of the book, or if you only wish to do the "Extra Credit" work, or if you just want to examine the results without doing the tutorials directly yourself, you can download the results of each tutorial's step-by-step instructions from the book's github repository. You can either clone the repository, or click the Download Source button in the upper-right to get the source as a ZIP file. The source code is organized by tutorial number, so you can readily find the project(s) associated with a particular tutorial from the book.
Note that while you are welcome to copy and paste code out of the book, you may wish to copy from the full source code instead. A side-effect of the way the source code listings are put into this book makes them difficult to copy from some PDF viewers, for example.
The tutorials do not assume you are using Eclipse, let alone any other specific editor or debugger. The instructions included in the tutorials will speak in general terms when it comes to tools outside of those supplied by the Android SDK itself.
The code for the tutorials has been tested most recently on Android 2.2. It should work on older versions as well, on the whole.
The tutorials include instructions for both Linux and Windows XP. OS X developers should be able to follow the Linux instructions in general, making slight alterations as needed for your platform. Windows Vista users should be able to follow the Windows XP instructions in general, tweaking the steps to deal with Vista's directory structure and revised Start menu.
If you wish to use the source code from the CommonsWare Web site, bear in mind a few things:
- The projects are set up to be built by Ant, not by Eclipse. If you wish to use the code with Eclipse, you will need to create a suitable Android Eclipse project and import the code and other assets.
- You should delete build.xml, then run
android update project -p ...
(where ... is the path to a project of interest) on those projects you wish to use, so the build files are updated for your Android SDK version.
Also, please note that the tutorials are set up to work well on HVGA and larger screen sizes. Using them on QVGA or similar sizes is not recommended.
Warescription
This book will be published both in print and in digital form. The digital versions of all CommonsWare titles are available via an annual subscription the Warescription.
The Warescription entitles you, for the duration of your subscription, to digital forms of all CommonsWare titles, not just the one you are reading. Presently, CommonsWare offers PDF and Kindle; other digital formats will be added based on interest and the openness of the format.
Each subscriber gets personalized editions of all editions of each title: both those mirroring printed editions and in-between updates that are only available in digital form. That way, your digital books are never out of date for long, and you can take advantage of new material as it is made available instead of having to wait for a whole new print edition. For example, when new releases of the Android SDK are made available, this book will be quickly updated to be accurate with changes in the APIs.
From time to time, subscribers will also receive access to subscriber-only online material, including not-yet-published new titles.
Also, if you own a print copy of a CommonsWare book, and it is in good clean condition with no marks or stickers, you can exchange that copy for a free four-month Warescription.
If you are interested in a Warescription, visit the Warescription section of the CommonsWare Web site.
What's New
For those of you who have a Warescription, or otherwise have been keeping up with this book, here is what is new in this version: