PacktLib: Flash Development for Android Cookbook

Flash Development for Android Cookbook

Credits

Foreword

About the Author

About the Reviewers

www.PacktPub.com

Preface

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

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

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

How it works...

There's more...

See also…

Retrieving device geolocation sensor data

Adjusting the geolocation sensor update interval

Retrieving map data through geolocation coordinates

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

Rich Media Presentation: Working with Images, Video, and Audio

Introduction

Loading photographs from the device cameraRoll

How it works…

There's more…

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

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

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

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

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

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

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