Hello World using Apollo/Adobe AIR

Its been days that I was trying to write a simple app using AIR, the buzz word these days, so downloaded the following

  1. Adobe AIR SDK.
  2. Adobe AIR SDK documentation.

Extract these above stuff after downloading. The documentation is quite good for a HTML /Javascript developer like me. Here I write a Hello World html file using AIR framework.

There are three things to be done

  1. Application XML file.
  2. HTML File.
  3. Executing the application.
Application XML File
  1. Create a XML file named <AppName>-app.xml, here appname can be HelloAIR.
  2. The structure of XML is

xml.gif

The text of rootContent element represents the name of the html file that is associated with the xml.

HTML File

The following the html code

HTML Code

The appLoad is invoked when the page is loaded. As shown above we are including the standard AIRAliases.js file in the HTML file, so AIR runtime will be initialized. If its initialized the Air.Trace statement is used to print on AIR console “Hello Air”. Then XMLHTTP request is made for getting request.txt file and dumping the content of that file onto the AIR console.

Executing the Application

When the AIR sdk is extracted there are two programs that come

  1. ADL: To execute the AIR application
  2. ADT: to package the AIR application

Use the adl command to execute the AIR application.

The ADL command

When you execute the command with XML as parameter then the following is displayed

commandline.gif

execute.gif

As shown above the Hello.AIR is the Air.Trace output and the white console displays thee content of the request.txt file.