Table of Contents
Headings formatted in bold-italic have changed since the last version.
Preface
Welcome to the Book!
Thanks!
Thanks for your interest in developing applications for Android! Android hasgrown from nothing to arguably the worlds most popular smartphone OS in a fewshort years. Whether you are developing applications for the public, for yourbusiness or organization, or are just experimenting on your own, I think youwill find Android to be an exciting and challenging area for exploration.
And, most of all, thanks for your interest in this book! I sincerely hope youfind it useful and at least occasionally entertaining.
The Books Structure
As you may have noticed, this is a rather large book.
To make the equivalent of ~3,500+ pages of material manageable, the chapters aredivided into the core chapters and a series of trails.
The core chapters represent many key concepts that Android developers need tounderstand in order to build an app. While an occasional nice to have topicwill drift into the core to help illustrate a point, for example the corechapters generally are fairly essential.
The core chapters are designed to beread in sequence and will interleave both traditional technical book prosewith tutorial chapters, to give you hands-on experience with theconcepts being discussed. Most of the tutorials can be skipped, though the firsttwo covering setting up your SDK environment and creating a project everybody should read.
The bulk of the chapters are divided into trails, covering some particulargeneral topic, from data storage to advanced UI effects to performance measurementand tuning. Each trail will have several chapters. However, those chapters, andthe trails themselves, are not necessarily designed to be read in any order.Each chapter in the trails will point out prerequisite chapters or conceptsthat you will want to have covered in advance. Hence, these chapters are mostlyreference material, for when you specifically want to learn something about aspecific topic.
The core chapters will link to chapters in the trails, to show you where youcan find material related to the chapter you just read. So between thebooks table of contents, this preface, the search tool in your digital bookreader, and the cross-chapter links, you should have plenty of ways of findingthe material you want to read.
You are welcome to read the entire book front-to-back if you wish. The trailswill appear after the core chapters. Those trails will be in a reasonably logicalorder, though you may have to hop around a bit to cover all of the prerequisites.
The Trails
Here is a list of all of the trails and the chapters that pertain to thosetrails, in order of appearance (except for those appearing in the listmultiple times, where they span major categories):
Code Organization and Gradle
Testing
Advanced UI
Home Screen Effects
Data Storage and Retrieval
Advanced Network Topics
Media
Security
Hardware and System Services
Integration and Introspection
Other Tools
Tuning Android Applications
Scripting Languages
Miscellaneous Topics
Widget Catalog
Device Catalog
Appendices
About the Updates
This book is updated frequently, typically every 6-8 weeks.
Each release has notations to show what is new or changed compared with theimmediately preceding release:
- The Table of Contents shows sections with changes in bold-italic font
- Those sections have changebars on the right to denote specific paragraphsthat are new or modified
Whats New in Version 7.4?
For those of you who have read previous editions of this book, hereare some of the highlights of what is new in the prose in Version 7.4:
- Added , includingmaterial on Android Ns cross-app drag-and-drop
- Added ,including material on Android Ns keyboard shortcuts helper
- Added using Jacoco
- Updated the chapter on Android N, including updates to the multi-windowand
TileService
material, a new section on MessagingStyle
, and anew section on the frame metrics API - Updated the TinyTextEditor sample to handle
ACTION_EDIT
requests,in addition to using the Storage Access Framework to open documentsfrom within the app itself - Added a section on EXIF header manipulation in
- Added a section on keyboard navigation in
- Added more material on greenrobot EventBus 3.x
- Added material on the use of
FLAG_SECURE
and its limitations - Updated the coverage of ACRA to align with ACRA 4.9.0
- Added some notes in the chapters on Chrome OS and desktop-style appsabout the impending availability of Android apps on Chrome OS
- Removed most of the references to Eclipse, with coverage now limitedto its historical role
Warescription
You (hopefully) are reading this digital book by means of a Warescription.
The Warescription entitles you, for the duration of your subscription, to digitaleditions of this book and its updates, in PDF, EPUB, and Kindle (MOBI/KF8) formats.You also have access to a version of the book as its own Android APK file, completewith high-speed full-text searching.You also have access to other titles that CommonsWare may publish during thatsubscription period.
Each subscriber gets personalized editions of all editions of each title. That way,your books are never out of date for long, and youcan take advantage of new material as it is made available. For example, when new releases of theAndroid SDK are made available, this book will be quickly updated to beaccurate with changes in the APIs.
However, you can only download the books while you have an active Warescription.There is a grace period after your Warescription ends: you can stilldownload the book until the next book update comes out after yourWarescription ends. After that, you can no longer download the book.Hence, please download your updates as they come out.You can find out when new releasesof this book are available via:
- The CommonsWare Twitter feed
- The CommonsBlog
- The Warescription newsletter, which you can subscribe to off of yourWarescription page
- Just check back on the Warescription site everymonth or two
Subscribers also have access to other benefits, including:
- Office hours online chats to help you getanswers to your Android application development questions. You will find a calendarfor these on your Warescription page.
- A Stack Overflow bump service, to get additional attention for a questionthat you have posted there that does not have an adequate answer.
About the APK Edition
In addition to classic digital book formats (PDF, EPUB, MOBI/Kindle),this book is available as an Android app, in the form of an APK file.This app has an integrated digital book reader, showing you the samecontents as you would find in the EPUB version of the book. However,it has a few features that are unique.
First, it has a very fast full-text-search index built in. You canquickly search for keywords, class names, and the like, with sub-secondresponse time on most Android hardware. You can even use booleansearch clauses (e.g., search on encryption OR decryption
).
Second, it has Community Theater, where you can view appinars, orapp-based training modules. These are presentations, complete withslides, videos, screencasts, source code, and more. Through CommunityTheater, you can view available appinars, download those of interest,and watch them when you want.