You are previewing Flash Development for Android Cookbook.
O'Reilly logo
Flash Development for Android Cookbook

Book Description

Over 90 recipes to build exciting Android applications with Flash, Flex, and AIR

  • The quickest way to solve your problems with building Flash applications for Android

  • Contains a variety of recipes to demonstrate mobile Android concepts and provide a solid foundation for your ideas to grow

  • Learn from a practical set of examples how to take advantage of multitouch, geolocation, the accelerometer, and more

  • Optimize and configure your application for worldwide distribution through the Android Market

  • Part of Packt's Cookbook series: Each recipe is a carefully organized sequence of instructions to complete the task as efficiently as possible

In Detail

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

Table of Contents

  1. Flash Development for Android Cookbook
    1. Flash Development for Android Cookbook
    2. Credits
    3. Foreword
      1. Mobile is as HOT as a Habanero Chili!
        1. Android with a dash of Flash
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
        3. Instant Updates on New Packt Books
    7. Preface
        1. What this book covers
      1. What you need for this book
      2. Who this book is for
      3. Conventions
      4. Reader feedback
      5. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Getting Ready to Work with Android: Development Environment and Project Setup
      1. Introduction
      2. Using Flash Professional CS5.5 to develop Android applications
        1. How to do it…
        2. How it works…
        3. There's more…
      3. Targeting AIR for Android with Flash Professional CS5.5
        1. How to do it…
        2. How it works…
        3. There's more…
        4. See also…
      4. Using Flash Builder 4.5 to develop Android applications
        1. How to do it…
        2. How it works…
        3. See also…
      5. Enabling Flash Builder 4 or Flex Builder to access Flex Mobile SDKs
        1. How to do it…
        2. How it works…
        3. There's more…
        4. See also…
      6. Using Flash Builder 4 and below to develop Android applications
        1. How to do it…
        2. How it works…
        3. See also…
      7. Enabling Powerflasher FDT 4.1 to access Flex Mobile SDKs
        1. How to do it…
        2. How it works…
        3. See also…
      8. Using Powerflasher FDT 4.1 and below to develop Android applications
        1. How to do it…
        2. How it works…
        3. See also…
      9. Converting a standard Flex project to a Flex Mobile project
        1. How to do it…
        2. How it works…
        3. There's more…
      10. Configuring the AIR SDK to package AIR for Android applications on Windows
        1. How to do it…
        2. How it works…
        3. See also…
      11. Configuring the AIR SDK to package AIR for Android applications on Linux or Mac OS
        1. How to do it…
        2. How it works…
        3. See also…
    9. 2. Interaction Experience: Multitouch, Gestures, and Other Input
      1. Introduction
      2. Detecting supported device input types
        1. How to do it...
        2. How it works...
      3. Detecting whether or not a device supports multitouch
        1. How to do it...
        2. How it works...
        3. There's more...
      4. Verifying specific gesture support for common interactions
        1. How to do it...
        2. How it works...
        3. There's more...
      5. Using gestures to zoom a display object
        1. How to do it...
        2. How it works...
        3. There's more...
        4. See also...
      6. Using gestures to pan a display object
        1. How to do it...
        2. How it works...
        3. There's more...
        4. See also...
      7. Using gestures to swipe a display object
        1. How to do it...
        2. How it works...
        3. There's more...
        4. See also...
      8. Using gestures to rotate a display object
        1. How to do it...
        2. How it works...
        3. There's more...
        4. See also...
      9. Accessing raw touchpoint data
        1. How to do it...
        2. How it works...
        3. There's more...
      10. Creating a custom gesture based upon touchPoint data
        1. How to do it...
        2. How it works...
        3. There's more...
      11. Emulating the Android long-press interaction
        1. How to do it...
        2. How it works...
        3. There's more...
      12. Invoking the virtual keyboard programmatically
        1. How to do it...
        2. How it works...
        3. There's more...
      13. Responding to Android soft-key interactions
        1. How to do it...
        2. How it works...
        3. There's more...
      14. Responding to trackball and D-Pad events
        1. How to do it...
        2. How it works...
        3. There's more...
    10. 3. Movement through Space: Accelerometer and Geolocation Sensors
      1. Introduction
      2. Detecting whether or not an Android device supports the accelerometer
        1. How to do it...
        2. How it works...
      3. Detecting Android device movement in 3D space
        1. How to do it...
        2. How it works...
        3. There's more...
      4. Adjusting the accelerometer sensor update interval
        1. How to do it...
        2. How it works...
        3. There's more...
      5. Updating display object position through accelerometer events
        1. How to do it...
        2. How it works...
      6. Switching between portrait and landscape based upon device tilt
        1. How to do it...
        2. How it works...
        3. There's more...
        4. See also…
      7. Detecting whether or not a device supports a geolocation sensor
        1. How to do it...
        2. How it works...
        3. See also…
        4. How to do it...
      8. How it works...
      9. There's more...
      10. See also…
      11. Retrieving device geolocation sensor data
        1. How to do it...
        2. How it works...
      12. Adjusting the geolocation sensor update interval
        1. How to do it...
        2. How it works...
        3. There's more...
      13. Retrieving map data through geolocation coordinates
        1. Getting ready...
        2. How to do it...
        3. How it works...
        4. There's more...
    11. 4. Visual and Audio Input: Camera and Microphone Access
      1. Introduction
      2. Detecting camera and microphone support
        1. How to do it...
        2. How it works...
        3. There's more...
      3. Using the traditional camera API to save a captured image
        1. How to do it...
        2. How it works...
        3. There's more...
        4. See also...
      4. Using the Mobile CameraUI API to save a captured photograph
        1. How to do it...
        2. How it works...
        3. There's more...
        4. See also...
      5. Using the Mobile CameraUI API to save a captured video
        1. How to do it...
        2. How it works...
        3. There's more...
        4. See also...
      6. Using the device microphone to monitor audio sample data
        1. How to do it...
        2. How it works...
          1. What do all these properties mean?
        3. See also...
      7. Recording Microphone Audio Sample Data
        1. How to do it...
        2. How it works...
        3. See also...
    12. 5. Rich Media Presentation: Working with Images, Video, and Audio
      1. Introduction
      2. Loading photographs from the device cameraRoll
        1. How to do it…
      3. How it works…
      4. There's more…
      5. Applying Pixel Bender Shader effects to loaded images
        1. Getting ready…
        2. How to do it…
        3. How it works…
        4. There's more…
      6. Playing video files from the local filesystem or over HTTP
        1. Getting ready…
        2. How to do it…
        3. How it works…
        4. There's more…
      7. Playing remote video streams over RTMP
        1. Getting ready…
        2. How to do it…
        3. How it works…
        4. There's more…
      8. Playing audio files from the local filesystem or over HTTP
        1. How to do it…
        2. How it works…
        3. There's more…
      9. Generating an audio spectrum visualizer
        1. How to do it…
        2. How it works…
        3. There's more…
      10. Generating audio tones for your application
        1. How to do it…
        2. How it works…
        3. There's more…
    13. 6. Structural Adaptation: Handling Device Layout and Scaling
      1. Introduction
      2. Detecting useable screen bounds and resolution
        1. How to do it…
        2. How it works…
      3. Detecting screen orientation changes
        1. How to do it…
        2. How it works…
        3. There's more…
        4. See also…
      4. Scaling visual elements across devices at runtime
        1. How to do it…
        2. How it works…
      5. Scaling visual elements based on stage resize in Flash Professional CS5.5
        1. How to do it…
        2. How it works…
        3. There's more…
      6. Employing the Project panel in Flash Professional CS5.5
        1. How to do it…
        2. How it works…
        3. There's more…
      7. Freezing a Flex application to landscape or portrait mode
        1. How to do it…
        2. How it works…
        3. There's more…
        4. See also…
      8. Defining a blank Flex mobile application
        1. How to do it…
        2. How it works…
        3. There's more…
      9. Defining a Flex mobile view-based application
        1. How to do it…
        2. How it works…
      10. Defining a Flex mobile tabbed application with multiple sections
        1. How to do it…
        2. How it works…
        3. There's more…
      11. Using a splash screen within a Flex mobile application
        1. How to do it…
        2. How it works…
      12. Configuring the ActionBar within a Flex mobile project for use with ViewNavigator
        1. How to do it…
        2. How it works…
        3. There's more…
      13. Hiding the ActionBar control in a single view for a Flex mobile project
        1. How to do it…
        2. How it works…
        3. There's more…
    14. 7. Native Interaction: StageWebView and URI Handlers
      1. Introduction
      2. Opening a website in the default Android browser
        1. How to do it...
        2. How it works...
        3. There's more...
      3. Rendering a website within an application
        1. How to do it...
        2. How it works...
        3. There's more...
      4. Managing the StageWebView history
        1. How to do it...
        2. How it works...
      5. Using StageWebView to load ads using ActionScript
        1. How to do it...
        2. How it works...
        3. There's more...
      6. Using StageWebView to load ads within a Flex mobile project
        1. Getting ready…
        2. How to do it...
          1. Creating the HTML file to display our ads
          2. Creating the MXML files for our ViewNavigatorApplication
            1. Generating the ActionScript code to tie it all together
          3. How it works...
          4. There's more...
      7. Making a phone call from an application
        1. How to do it...
        2. How it works...
      8. Sending a text message from an application
        1. How to do it...
        2. How it works...
      9. Invoking Google maps from an application
        1. How to do it...
        2. How it works...
        3. There's more...
      10. Invoking the Android Market using application URIs
        1. How to do it...
        2. How it works...
      11. Sending e-mail from an application
        1. How to do it...
        2. How it works...
        3. There's more...
    15. 8. Abundant Access: File System and Local Database
      1. Introduction
      2. Opening a local file from device storage
        1. How to do it...
        2. How it works...
        3. There's more...
      3. Saving a file to device storage
        1. How to do it...
        2. How it works...
        3. There's more...
      4. Saving data across sessions through local shared object
        1. How to do it...
        2. How it works...
        3. There's more...
      5. Storing application state automatically by using Flex
        1. How to do it...
        2. How it works...
      6. Creating a local SQLite database
        1. How to do it...
        2. How it works...
      7. Providing a default application database
        1. Getting ready...
        2. How to do it...
        3. How it works...
      8. Automating database tasks with FlexORM
        1. Getting ready...
        2. How to do it...
        3. How it works...
        4. There is more...
    16. 9. Manifest Assurance: Security and Android Permissions
      1. Introduction
      2. Setting application permissions with the Android Manifest file
        1. How to do it...
          1. Using Flash Professional:
          2. Using Flash Builder:
          3. Using a simple text editor:
          4. How it works...
      3. Preventing the device screen from dimming
        1. How to do it...
        2. How it works...
        3. See also...
      4. Establishing Android custom URI schemes
        1. How to do it...
        2. How it works...
        3. See also...
      5. Anticipating Android Compatibility Filtering
        1. How to do it...
          1. When using features of the Android camera:
          2. When using features of the Android microphone:
          3. When using the Geolocation Sensor:
          4. When using the Accelerometer Sensor:
        2. How it works...
        3. See also...
      6. Instructing an application to be installed to Device SDCard
        1. How to do it...
        2. How it works...
        3. See also...
      7. Encrypting a local SQLite database
        1. Getting ready...
          1. Instructions to include a .SWC package into a Flash Builder project
          2. Instructions to include a .SWC package into a Flash Professional project
        2. How to do it...
        3. How it works...
        4. See also...
    17. 10. Avoiding Problems: Debugging and Resource Considerations
      1. Introduction
      2. Debugging an application with Flash Professional
        1. Getting ready…
        2. How to do it...
        3. How it works...
        4. See also...
      3. Debugging an application with Flash Builder
        1. How to do it…
        2. How it works...
        3. See also...
      4. Rendering application elements using the device GPU
        1. How to do it...
          1. How it works...
          2. There's more...
      5. Automating application shutdown upon device interruption events
        1. How to do it...
          1. How it works...
          2. See also…
      6. Exiting your application with the device back button
        1. How to do it...
        2. How it works...
        3. There's more…
        4. See also…
      7. Monitoring memory usage and frame rate in an application
        1. How to do it...
        2. How it works...
        3. There's more...
        4. See also...
    18. 11. Final Considerations: Application Compilation and Distribution
      1. Introduction
      2. Generating a code-signing certificate using Flash Professional
        1. How to do it...
        2. How it works...
      3. Generating a code-signing certificate using Flash Builder
        1. How to do it...
        2. How it works...
      4. Generating a code-signing certificate using FDT
        1. How to do it...
        2. How it works...
      5. Generating a code-signing certificate using the AIR Developer Tool
        1. Getting ready…
        2. How to do it...
        3. How it works...
      6. Preparing icon files for distribution
        1. How to do it...
          1. Using Flash Professional CS5.5
          2. Direct modification of the AIR descriptor file
        2. How it works...
        3. There's more...
      7. Compiling an application using Flash Professional
        1. How to do it...
        2. How it works...
      8. Compiling an application using Flash Builder
        1. How to do it...
        2. How it works...
      9. Compiling an application when using FDT
        1. How to do it...
          1. Using a mobile project template
          2. Using ANT
          3. Using ADT through CLI
        2. How it works...
      10. Compiling an application using the AIR Developer Tool
        1. How to do it...
        2. How it works...
        3. See also…
      11. Submitting an application to the Android Market
        1. Getting ready...
        2. How to do it...
        3. How it works...
        4. There's more...