A breath of fresh AIR!

Adobe AIR has been blowing around the RIA arena for a while now and finally came out of beta at the beginning of the year. The idea is to allow web developers to user their existing tool kit (e.g. HTML, AJAX, Flash, etc.) to build applications that will run on the desktop and are independent of Operation System (currently works for Windows, Mac and Linux(beta)).

It all sounded very exciting, so I decided to begin with something simple and build a task manager app (I know it’s been done to death, but you’ve got to start some where). When I started there was no Linux version of AIR available so begrudgingly I downloaded the AIR runtime and the AIR SDK for windows. The AIR runtime is similar in principle to the Adobe Flash Player i.e. you need the Flash player installed on your machine to run Flash files. Once the runtime is installed you can go and download some example AIR apps from the Adobe website.

The AIR SDK contains some examples to get you started with your first app, so I did what had to be done and wrote a Hello world! AIR app. The initial configuration consisted of:

  • adding the path to the AIR Debug Launcher (adl) to the windows PATH environment
  • creating a folder for my AIR app and copying across the descriptor-template.xml
  • creating my html file
  • setting some values in the descriptor-template.xml

Then I simply fired up the windows command prompt, navigated into my AIR app directory and ran:
adl descriptor-template.xml
Hey-presto my first AIR app was launched. Not very exciting I know, but it didn’t feel difficult to achieve and I started to think of all the cool things you could do with a desktop based app.

With this new found enthusiasm I set to work on creating my task manager. The first thing I wanted to decide upon was which Javascript framework to use. At LCN Prototype + Scriptaculous is the default because it’s what comes with ruby on rails, but I had heard some good things about the MooTools framework and it worked with Adobe AIR out of the box (some frameworks that rely on eval() won’t work as it’s prohibited in the base Javascript on any AIR app).

Next I built my HTML page, added some CSS and a sprinkling of Javascript effects. Now I had to decide how to store my tasks. AIR gives you access to the file system and to the relational database SQLite. I decided to use the database as this meant I could get it to do the hard work for me using SQL queries, which I was already familiar with from other projects. With the aid of the Adobe AIR LiveDocs and being able to look at the source code of Snippely, an AIR app written by some of the guys who maintain the MooTools framework, I was able to get my app to create and delete tasks pretty quickly.

That’s as far as I’ve got with my first lung full of AIR and this is what I have learnt along the way:

  • my advanced Javascript skills are a little lacking at the moment
  • MooTools is a great framework with good documentation
  • the Firebug plugin for Firefox should be in every web developers toolbox already, I found it indispensable whilst writing my app
  • SQLite dates are funny little beasts
  • the Linux version of the AIR runtime is only for 32bit platforms (don’t know what Adobe has got against 64 bit architectures, there’s still no 64bit flash player either)

If I ever manage to get my task app into some state of usability I’ll post it for you all to see :)

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>