Flash Development for Android Cookbook(English, Paperback, Labrecque Joseph)
Quick Overview
Product Price Comparison
Flash has now arrived to Android — the fastest growing smartphone platform. This offers massive opportunities for Flash developers who want to get into mobile development. At the same time, working on smartphones will introduce new challenges and issues that Flash developers may not be familiar with. The Flash Development for Android Cookbook enables Flash developers to branch out into Android mobile applications through a set of essential, easily demonstrable recipes. It takes you through the entire development workflow: from setting up a local development environment, to developing and testing your application, to compiling for distribution to the ever-growing Android Market. The Flash Development for Android Cookbook starts off with recipes that cover development environment configuration as well as mobile project creation and conversion. It then moves on to exciting topics such as the use of touch and gestures, responding to device movement in 3D space, working with multimedia, and handling application layout. Essential tasks such as tapping into native processes and manipulating the file system are also covered. We then move on to some cool advanced stuff such as Android-specific device permissions, application debugging and optimization techniques, and the packaging and distribution options available on the mobile Android platform. In a nutshell, this cookbook enables you to get quickly up to speed with mobile Android development using the Flash Platform in ways that are meaningful and immediately applicable to the rapidly growing area of mobile application development. Take your Flash applications beyond the desktop and into the emerging world of mobile application development What you will learn from this book : Configure Flash Professional, Flash Builder, or FDT to develop Android applications cross-platform regardless of operating system Convert Flex and ActionScript projects to true mobile experiences Work with multitouch and gestures for a truly innovative user experience Use the geolocation and accelerometer sensors to respond to location and movement Make use of the built-in microphone and camera hardware for user generated content Stream audio and video to an application using a variety of protocols Use advanced image display and modifications using custom shaders Effectively scale and position the interface elements across devices Employ a variety of URI handlers to invoke native SMS, telephone, e-mail, maps, and more Work with the Android file system and manage application databases easily Compile and submit your application or game to the ever growing, worldwide Android Market Approach Written in cookbook style, this book offers solutions to all common Flash Android development problems through recipes. Each recipe contains step-by-step instructions followed by analysis of what was done in each task and other useful information. The book is designed so that you can read it chapter by chapter, or you can look at the list of recipes and refer to them in no particular order. Who this book is written for This book contains recipes covering a variety of topics from the very simple to those that are more advanced. If you are a seasoned Flash developer, this book will get you quickly up to speed with what is possible with Android. For those who are new to Flash, welcome to the world of visually rich, rapid application development for mobile Android devices! If you have any interest in Flash development for Android, this book is for you. About the Author Joseph Labrecque is primarily employed by the University of Denver as a senior interactive software developer specializing in the Adobe Flash Platform, where he produces innovative academic toolsets for both traditional desktop environments and emerging mobile spaces. Alongside this principal role; he often serves as adjunct faculty, communicating upon a variety of Flash Platform solutions and general Web design and development subjects. In addition to his accomplishments in higher education, Joseph is the proprietor of Fractured Vision Media, LLC; a digital media production company, technical consultancy, and distribution vehicle for his creative works. He is founder and sole abiding member of the dark ambient recording project "An Early Morning Letter, Displaced" whose releases have received international award nominations and underground acclaim. Joseph has contributed to a number of respected community publications as an article writer and video tutorialist. He regularly speaks at user group meetings and industry conferences such as Adobe MAX, FITC, and D2WC. In 2010, he received an Adobe Impact Award in recognition of his outstanding contribution to the education community. He has served as an Adobe Education Leader since 2008 and is also a 2011 Adobe Community Professional. Table of Contents Preface Chapter 1: Getting Ready to Work with Android: Development Environment and Project Setup Introduction Using Flash Professional CS5.5 to develop Android applications Targeting AIR for Android with Flash Professional CS5.5 Using Flash Builder 4.5 to develop Android applications Enabling Flash Builder 4 or Flex Builder to access Flex Mobile SDKs Using Flash Builder 4 and below to develop Android applications Enabling Powerflasher FDT 4.1 to access Flex Mobile SDKs Using Powerflasher FDT 4.1 and below to develop Android applications Converting a standard Flex project to a Flex Mobile project Configuring the AIR SDK to package AIR for Android applications on Windows Configuring the AIR SDK to package AIR for Android applications on Linux or Mac OS Chapter 2: Interaction Experience: Multitouch, Gestures, and Other Input Introduction Detecting supported device input types Detecting whether or not a device supports multitouch Verifying specific gesture support for common interactions Using gestures to zoom a display object Using gestures to pan a display object Using gestures to swipe a display object Using gestures to rotate a display object Accessing raw touchpoint data Creating a custom gesture based upon touchPoint data Emulating the Android long-press interaction Invoking the virtual keyboard programmatically Responding to Android soft-key interactions Responding to trackball and D-Pad events Chapter 3: Movement through Space: Accelerometer and Geolocation Sensors Introduction Detecting whether or not an Android device supports the accelerometer Detecting Android device movement in 3D space Adjusting the accelerometer sensor update interval Updating display object position through accelerometer events Switching between portrait and landscape based upon device tilt Detecting whether or not a device supports a geolocation sensor Retrieving device geolocation sensor data Adjusting the geolocation sensor update interval Retrieving map data through geolocation coordinates Chapter 4: Visual and Audio Input: Camera and Microphone Access Introduction Detecting camera and microphone support Using the traditional camera API to save a captured image Using the Mobile CameraUI API to save a captured photograph Using the Mobile CameraUI API to save a captured video Using the device microphone to monitor audio sample data Recording Microphone Audio Sample Data Chapter 5: Rich Media Presentation: Working with Images, Video, and Audio Introduction Loading photographs from the device cameraRoll Applying Pixel Bender Shader effects to loaded images Playing video files from the local filesystem or over HTTP Playing remote video streams over RTMP Playing audio files from the local filesystem or over HTTP Generating an audio spectrum visualizer Generating audio tones for your application Chapter 6: Structural Adaptation: Handling Device Layout and Scaling Introduction Detecting useable screen bounds and resolution Detecting screen orientation changes Scaling visual elements across devices at runtime Scaling visual elements based on stage resize in Flash Professional CS5.5 Employing the Project panel in Flash Professional CS5.5 Freezing a Flex application to landscape or portrait mode Defining a blank Flex mobile application Defining a Flex mobile view-based application Defining a Flex mobile tabbed application with multiple sections Using a splash screen within a Flex mobile application Configuring the ActionBar within a Flex mobile project for use with ViewNavigator Hiding the ActionBar control in a single view for a Flex mobile project Chapter 7: Native Interaction: StageWebView and URI Handlers Introduction Opening a website in the default Android browser Rendering a website within an application Managing the StageWebView history Using StageWebView to load ads using ActionScript Using StageWebView to load ads within a Flex mobile project Making a phone call from an application Sending a text message from an application Invoking Google maps from an application Invoking the Android Market using application URIs Sending e-mail from an application Chapter 8: Abundant Access: File System and Local Database Introduction Opening a local file from device storage Saving a file to device storage Saving data across sessions through local shared object Storing application state automatically by using Flex Creating a local SQLite database Providing a default application database Automating database tasks with FlexORM Chapter 9: Manifest Assurance: Security and Android Permissions Introduction Setting application permissions with the Android Manifest file Preventing the device screen from dimming Establishing Android custom URI schemes Anticipating Android Compatibility Filtering Instructing an application to be installed to Device SDCard Encrypting a local SQLite database Chapter 10: Avoiding Problems: Debugging and Resource Considerations Introduction Debugging an application with Flash Professional Debugging an application with Flash Builder Rendering application elements using the device GPU Automating application shutdown upon device interruption events Exiting your application with the device back button Monitoring memory usage and frame rate in an application Chapter 11: Final Considerations: Application Compilation and Distribution Introduction Generating a code-signing certificate using Flash Professional Generating a code-signing certificate using Flash Builder Generating a code-signing certificate using FDT Generating a code-signing certificate using the AIR Developer Tool Preparing icon files for distribution Compiling an application using Flash Professional Compiling an application using Flash Builder Compiling an application when using FDT Compiling an application using the AIR Developer Tool Submitting an application to the Android Market Index