Developing Android Applications with Adobe AIR Véronique Brossier Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo Developing Android Applications with Adobe AIR by Véronique Brossier Copyright © 2011 Véronique Brossier. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or [email protected]. Editor: Mary Treseler Indexer: John Bickelhaupt Production Editor: Kristen Borg Cover Designer: Karen Montgomery Copyeditor: Audrey Doyle Interior Designer: David Futato Proofreader: Kristen Borg Illustrator: Robert Romano Printing History: May 2011: First Edition. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Developing Android Applications with Adobe AIR, the image of a Royal Flycatcher, and related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information con- tained herein. ISBN: 978-1-449-39482-0 [LSI] 1303389007 A mon père. A ma mère. Adobe Developer Library, a copublishing partnership between O’Reilly Media Inc., and Adobe Systems, Inc., is the authoritative resource for developers using Adobe technologies. These comprehensive resources offer learning solutions to help devel- opers create cutting-edge interactive web applications that can reach virtually any- one on any platform. With top-quality books and innovative online resources covering the latest tools for rich-Internet application development, the Adobe Developer Library delivers expert training straight from the source. Topics include ActionScript, Adobe Flex®, Adobe Flash®, and Adobe Acrobat®. Get the latest news about books, online resources, and more athttp://adobedeveloper library.com. Untitled-1 1 3/3/09 5:37:20 PM Table of Contents Foreword .................................................................. xvii Preface .................................................................... xix 1. AIR ................................................................... 1 Installing the Adobe Development Tools 2 Flash Professional CS5.5 2 Flash Builder 4.5 2 Installing the AIR Runtime on an Android Device 2 What Is in the AIR SDK 3 New ActionScript Libraries 4 Functionalities Not Yet Supported 5 AIR on the Desktop Versus AIR on Android 5 Mobile Flash Player 10.1 Versus AIR 2.6 on Android 6 2. Call Me, Text Me ........................................................ 7 Setting Up Your Device 8 Creating a Project 8 Using Flash Professional 8 Using Flash Builder 9 Creating the Application Descriptor 9 Using Flash Professional 9 Using Flash Builder 9 Writing the Code 10 Using Flash Professional 11 Using Flash Builder 12 Packaging Your Application As an APK File and Installing It on the Device 12 Using Flash Professional 12 Using Flash Builder 13 Testing and Debugging 13 vii Using Flash Professional 13 Using Flash Builder 14 Mobile Utility Applications 15 Launchpad 15 Device Central CS5 15 Package Assistant Pro 15 De MonsterDebugger 16 Installing AIR on an Android Device via a Server 16 Other Tools 16 Conclusion 18 3. Android .............................................................. 19 Android Software Development Kit 20 Installing the Android SDK 20 Installing the Android Debug Bridge 21 Detecting Your Device 22 Using the Dalvik Debug Monitor 22 Using the logcat Command 23 Using the Virtual Device Manager and Emulator 24 How Does AIR Run on Android? 25 Starting AIR with intent 25 AIR Access to Android APIs 26 Using the Command-Line Tool 27 A Basic Review 27 Conclusion 28 4. Permissions, Certificates, and Installation .................................. 29 Why Mobile? 29 The APK File 30 Creating the Application Icon 30 Choosing the Application Settings 31 Setting Permissions 33 Packaging External Resources 36 Signing Your Application with a Certificate 36 Versioning 37 Registering As an Android Developer 38 Publishing an Application on the Android Market 38 Uploading Assets 38 Listing Details 38 Publishing Options 39 Distributing Applications via Adobe InMarket 39 Publishing for the Amazon Market 40 Controlling Distribution by Using the MAC Address 40 viii | Table of Contents
Description: