Supplemental files and examples for this book can be found at http://examples.oreilly.com/0636920013884/. Please use a standard desktop web browser to access these files, as they may not be accessible from all ereader devices.
All code files or examples referenced in the book will be available online. For physical books that ship with an accompanying disc, whenever possible, weve posted all CD/DVD content. Note that while we provide as much of the media content as we are able via free download, we are sometimes limited by licensing restrictions. Please direct any questions or concerns to .
Foreword
Arno Gourdol, Director of Engineering, Flash Runtime Foundation
Building engaging experiences for stand-alone applications is much harder than it should be. With Adobe AIR, we give developers and designers a tool to turn their ideas into applications quickly and easily. As new mobile platforms emerged, we have extended the reach of our customers by bringing AIR to those platforms. Vroniques book is a great introduction to everything you need to know to use AIR to build some awesome applications, taking advantage of some of the new capabilities available on mobile platforms, like geolocation, touch, and other sensors. Now get coding!
Preface
If you cant explain it simply, you dont understand it well enough.
Albert Einstein
The proliferation of the cellular phone has revolutionized the way we connect to the world and communicate with one another. It is the foundation of a mobile lifestyle.
Although the evolution of cell phone technology is progressing thanks to hardware manufacturers and platform engineers, the unveiling of its potential is in the hands of application creators.
Toward that end, Google and the Open Handset Alliance have developed Android , an operating system that runs on many mobile devices. Adobe and the Open Screen Project offer AIR as a development tool for various mobile systems. Both efforts bring some uniformity to this fragmented world.
This book is about developing for the Android platform using Adobe AIR. My goal is to provide in-depth information on the various topics specific to mobile development. My wish is that this book will help you create quality applications .
Audience
This book is for developers. It aims to attract enthusiast coders who are curious about both the technology and the user experience. I try to provide as much background information as possible on all topics, and not just an ActionScript reference guide.
Today is still the beginning of the mobile era, and any one of you is a potential innovator. Your contribution can influence the future of mobile technology.
Assumptions This Book Makes
This book assumes you already have basic to intermediate experience with the ActionScript 3 language. For example, you should know how to create an event listener, understand different data types, and know what a class is. If you need to learn the fundamentals of the language or get a refresher, I recommend Essential ActionScript 3.0 by Colin Moock (OReilly).
I introduce each topic from the ground up. I also provide code samples in snippets so that you can absorb the concept in small steps. Finally, I use pure ActionScript only, and few third-party libraries.
Contents of This Book
This book is divided into four sections:
Chapters go over the technology, the environment, and the fundamentals of creating and publishing an AIR application.
Chapters cover functionality-specific topics like multitouch technology, using the accelerometer, using the native camera, geolocation, audio, video, and more.
Chapters cover some more advanced topics, propose an architecture to manage multiple views, and offer the code for a full application.
Chapters provide suggestions on best practices for asset management and development.
In addition, this book has a companion website from which you can download code samples that you can compile and install on your mobile device.
Conventions Used in This Book
The following typographical conventions are used in this book:
ItalicIndicates filenames, file extensions, directory paths, URLs, email addresses, and new terms where they are defined
Constant width
Indicates language and script elements, such as class names, types, namespaces, attributes, methods, variables, keywords, functions, modules, commands, properties, parameters, values, objects, events, XML and HTML tags, and similar elements
Constant width bold
Indicates commands or text to be typed by the user
Constant width italic
Indicates text that should be replaced with user-supplied values
Note
This icon signifies a tip, suggestion, or general note.
Warning
This icon indicates a warning or caution.
Note that I prefer placing curly braces on the same line of code, as I feel this makes the code easier to read in print form and does not use space unnecessarily. I also did away with the convention of private variables with an underscore for the same reason.
I introduce a new API or class in small code segments to illustrate an explanation .
Using Code Examples
This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless youre reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from this book does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your products documentation does require permission.
We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: