Cover image for AIR for Javascript Developers Pocket Guide

Book description

This book is the official guide to Adobe ® AIR[TM], written by members of the AIR team. With Adobe AIR, web developers can use technologies like HTML and JavaScript to build and deploy web applications to the desktop. Packed with examples, this book explains how AIR works and features recipes for performing common runtime tasks. Part of the Adobe Developer Library, this concise pocket guide explains:

  • What Adobe AIR is, and the problems this runtime aims to solve

  • How to set up your development environment

  • The HTML and JavaScript environments within AIR

  • How to create your first AIR application using HTML and JavaScript

  • Ways to perform an array of common tasks with this runtime

Also included is a guide to AIR packages, classes, and command line tools. Once you understand the basics of building HTML- and JavaScript-based AIR applications, this book makes an ideal reference for tackling specific problems. It offers a quick introduction to a significant new development technology, which lets you combine the reach and ease of the Web with the power of the desktop.

Table of Contents

  1. Special Upgrade Offer
  2. Preface
    1. Adobe AIR Runtime Naming Conventions
    2. What This Book Covers
    3. Errors and Errata
    4. Audience for This Book
      1. Who This Book Is For
      2. What Does This Book Assume?
      3. Who This Book Is Not For
    5. How This Book Is Organized
    6. How to Use This Book
    7. Conventions Used in This Book
    8. License and Code Examples
    9. Support and More Information
      1. Accessing the Book Online
      2. Online Adobe AIR Resources
    10. About the Authors
      1. Mike Chambers
      2. Daniel Dura
      3. Dragos Georgita
      4. Kevin Hoyt
    11. Acknowledgments
  3. 1. Introduction to Adobe AIR
    1. A Short History of Web Applications
    2. Problems with Delivering Applications via the Browser
      1. Conflicting UI
      2. Distance from the Desktop
      3. Primarily Online Experience
      4. Lowest Common Denominator
    3. Introducing Adobe AIR
    4. Primary Adobe AIR Technologies
      1. Primary Application Technologies
        1. HTML/JavaScript
        2. Adobe Flash
      2. Primary Document Technologies
        1. PDF
        2. HTML
      3. What Does an Adobe AIR Application Contain?
        1. Technology integration and script bridging
      4. Adobe AIR Functionality
        1. Adobe AIR APIs
        2. Adobe AIR desktop integration
      5. Security Model
      6. Adobe AIR Development Toolset
      7. Is Adobe AIR the End of Web Applications in the Browser?
  4. 2. Getting Started with Adobe AIR Development
    1. What Do You Need to Develop Adobe AIR Applications?
      1. Adobe AIR Runtime
      2. Adobe AIR SDK
      3. HTML/JavaScript IDE or Editor
      4. Supported Operating System
    2. Uninstalling Prerelease Versions of Adobe AIR
      1. Uninstalling on Windows
      2. Uninstalling on Mac
    3. Installing Adobe AIR
    4. Uninstalling Adobe AIR
      1. Uninstalling on Windows
      2. Uninstalling on an Mac
    5. Setting Up the Adobe AIR SDK and Command-Line Tools
      1. Installing the Adobe AIR SDK
      2. Placing the Command-Line Tools Within the System Path
      3. Windows
      4. Mac
    6. Creating a Simple AIR Application with HTML and JavaScript
      1. Creating the Application Files
        1. Understanding application descriptor files
        2. Creating the root application file
        3. Accessing Adobe AIR APIs
    7. Testing the Application
      1. Using ADL to Launch the Application
      2. Capturing Output from the Application at Runtime
        1. Runtime JavaScript errors
        2. runtime.trace
    8. Packaging and Deploying the AIR Application
      1. What Is an AIR File?
      2. Digitally Signing AIR Files
        1. Signing with a self-signed certificate
        2. Signing with a CA-issued certificate
      3. Creating an AIR File Using ADT
        1. Generating a self-signed certificate
        2. Generating an AIR file
      4. Testing and Installing the AIR File
      5. Deploying the AIR File
        1. Setting the MIME type
  5. 3. Working with JavaScript and HTML Within Adobe AIR
    1. WebKit Within Adobe AIR
      1. Why WebKit?
        1. Open project
        2. Proven technology that web developers know
        3. Minimum effect on AIR runtime size
        4. Proven ability to run on mobile devices
      2. WebKit version used within Adobe AIR
    2. JavaScript within Adobe AIR
    3. AIR Implementation of Functionality
      1. URI Schemes
        1. Supported URI schemes
        2. Unsupported URI schemes
        3. AIR URI Schemes
      2. Relative URLs
      3. Cookies
      4. Windowing
        1. Windows
        2. Dialogs
      5. XMLHttpRequest and Ajax
      6. Canvas object
      7. Clipboard object
      8. Drag and drop
      9. Supported plug-ins
      10. Unsupported functionality
    4. Security Model
      1. Why a different security model?
      2. Adobe AIR Sandboxes
        1. Application sandbox
        2. Non-application sandbox
      3. Developing within the Sandboxes
        1. Developing within the application sandbox
          1. Loading remote JavaScript files
          2. Cross-domain content loading
        2. Developing within the non-application sandbox
          1. Creating a non-application sandbox
          2. Differences on code running under non-application sandbox
        3. Scripting between sandboxes
          1. Using the Sandbox Bridge
    5. Using JavaScript Frameworks
      1. JavaScript Frameworks and Libraries supporting AIR application sandbox
      2. Ajax frameworks and libraries compatible with AIR application sandbox at the time of authoring this book
      3. Accessing AIR APIs from JavaScript
      4. The JavaScript environment and its relationship with AIR
      5. Accessing AIR and Flash Player APIs
        1. Working with AIR and Flash Player Events
        2. Using AIRAliases.js file
        3. Leveraging Compiled ActionScript Libraries
    6. Troubleshooting AIR Applications
      1. New JavaScript error messages
        1. Security violation for Javascript code
        2. Referencing a JavaScript object no longer available
        3. Missing event listeners for error events
      2. AIR Introspector
  6. 4. Adobe AIR Mini-Cookbook
    1. Application Deployment
      1. Deploy from a Web Page
        1. Problem
        2. Solution
        3. Discussion
    2. Application Chrome
      1. Add Custom Controls
        1. Problem
        2. Solution
        3. Discussion
        4. application.xml
        5. index.html
    3. Windowing
      1. Create a New Window
        1. Problem
        2. Solution
        3. Discussion
        4. Login.html
      2. Create a New Native Window
        1. Problem
        2. Solution
        3. Discussion
        4. Login.html
      3. Create Full-Screen Windows
        1. Problem
        2. Solution
        3. Discussion
    4. File API
      1. Write Text to a File from a String
        1. Problem
        2. Solution
        3. Discussion
      2. Synchronously Read Text from a File
        1. Problem
        2. Solution
        3. Discussion
      3. Asynchronously Read Text from a File
        1. Problem
        2. Solution
        3. Discussion
      4. Load Data from an XML File
        1. Problem
        2. Solution
        3. Discussion
        4. Given
        5. Example
      5. Create a Temporary File
        1. Problem
        2. Solution
        3. Discussion
      6. Iterate the Contents of a Directory
        1. Problem
        2. Solution
        3. Discussion
    5. File Pickers
      1. Browse for a File
        1. Problem
        2. Solution
        3. Discussion
      2. Browse for Multiple Files
        1. Problem
        2. Solution
        3. Discussion
      3. Browse for a Directory
        1. Problem
        2. Solution
        3. Discussion
    6. Service and Server Monitoring
      1. Monitor Connectivity to an HTTP Server
        1. Problem
        2. Solution
        3. Discussion
      2. Monitor Connectivity to a Jabber Server
        1. Problem
        2. Solution
        3. Discussion
    7. Online/Offline
      1. Cache Assets for Offline Use
        1. Problem
        2. Solution
        3. Discussion
    8. Drag-and-Drop
      1. Use Drag—and-Drop from HTML
        1. Problem
        2. Solution
        3. Discussion
    9. Embedded Database
      1. Connect to a Database
        1. Problem
        2. Solution
        3. Discussion
      2. Create Database Tables
        1. Problem
        2. Solution
        3. Discussion
      3. Store Data in a Database
        1. Problem
        2. Solution
        3. Discussion
      4. Access Database Data
        1. Problem
        2. Solution
        3. Discussion
    10. Command-Line Arguments
      1. Capture Command-Line Arguments
        1. Problem
        2. Solution
        3. Discussion
    11. Networking
      1. Communicate on a Socket
        1. Problem
        2. Solution
        3. Discussion
      2. Upload a File in the Background
        1. Problem
        2. Solution
        3. Discussion
    12. Sound
      1. Play a Sound
        1. Problem
        2. Solution
        3. Discussion
  7. A. AIR JavaScript Aliases
  8. Index
  9. About the Authors
  10. Special Upgrade Offer
  11. Copyright