31.07.2013 Views

Building Adobe AIR Applications

Building Adobe AIR Applications

Building Adobe AIR Applications

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

BUILDING ADOBE <strong>AIR</strong> APPLICATIONS<br />

Creating your first <strong>AIR</strong> application<br />

Install the application on a desktop<br />

Now that you’ve created the application file, you can install it on any desktop.<br />

1 Move the <strong>Adobe</strong> <strong>AIR</strong> application file out of your Dreamweaver site and onto your desktop, or to another desktop.<br />

This step is optional. You can actually install the new application on your computer right from your Dreamweaver<br />

site directory if you prefer.<br />

2 Double-click the application executable file (.air file) to install the application.<br />

Preview the <strong>Adobe</strong> <strong>AIR</strong> application<br />

You can preview pages that will be part of <strong>AIR</strong> applications at any time. That is, you don’t necessarily need to package<br />

the application before seeing what it will look like when it’s installed.<br />

1 Make sure your hello_world.html page is open in the Dreamweaver Document window.<br />

2 On the Document toolbar, click the Preview/Debug in Browser button, and then select Preview In <strong>AIR</strong>.<br />

You can also press Ctrl+Shift+F12 (Windows) or Cmd+Shift+F12 (Macintosh).<br />

When you preview this page, you are essentially seeing what a user would see as the start page of the application<br />

after they’ve installed the application on a desktop.<br />

Creating your first HTML-based <strong>AIR</strong> application with the<br />

<strong>AIR</strong> SDK<br />

For a quick, hands-on illustration of how <strong>Adobe</strong>® <strong>AIR</strong>® works, use these instructions to create and package a simple<br />

HTML-based <strong>AIR</strong> “Hello World” application.<br />

To begin, you must have installed the runtime and set up the <strong>AIR</strong> SDK. You will use the <strong>AIR</strong> Debug Launcher (ADL)<br />

and the <strong>AIR</strong> Developer Tool (ADT) in this tutorial. ADL and ADT are command-line utility programs and can be<br />

found in the bin directory of the <strong>AIR</strong> SDK (see “Installing the <strong>AIR</strong> SDK” on page 16). This tutorial assumes that you<br />

are already familiar with running programs from the command line and know how to set up the necessary path<br />

environment variables for your operating system.<br />

Note: If you are an <strong>Adobe</strong>® Dreamweaver® user, read “Create your first HTML-based <strong>AIR</strong> application with<br />

Dreamweaver” on page 29.<br />

Note: HTML-based <strong>AIR</strong> applications can only be developed for the desktop and the extendedDesktop profiles. The mobile<br />

profile is not supported.<br />

Create the project files<br />

Every HTML-based <strong>AIR</strong> project must contain the following two files: an application descriptor file, which specifies the<br />

application metadata, and a top-level HTML page. In addition to these required files, this project includes a JavaScript<br />

code file, <strong>AIR</strong>Aliases.js, that defines convenient alias variables for the <strong>AIR</strong> API classes.<br />

1 Create a directory named HelloWorld to contain the project files.<br />

2 Create an XML file, named HelloWorld-app.xml.<br />

3 Create an HTML file named HelloWorld.html.<br />

4 Copy <strong>AIR</strong>Aliases.js from the frameworks folder of the <strong>AIR</strong> SDK to the project directory.<br />

Last updated 7/8/2013<br />

31

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!