Archive for March, 2009

Adobe AIR: Introduction and Overview

As I was preparing for tomorrows RIA Meetup, it dawned on me that it probably would be a good idea to use my blog as a way to both document and share the work that goes into the meetups. From now on (time permitting), every time we have a meetup, I’ll try to accompany it with a blog post.  Now on to the content:

Adobe AIR is runtime environment that liberates RIAs from the browser and brings them right onto a users desktop.  When I first heard of a AIR prior to it’s formal release, I (mistakenly) thought of it as an extension to the Flex SDK.  While this is correct in a limited sense, defining AIR in this way is too narrow.

In truth, AIR is desktop runtime that enables developers to build rich, web-enabled applications that are installed on a users OS.  Developers can build AIR apps with their choice of Flex, Flash, and even DHTML.  In the rest of this post I’ll build a case for why one would choose AIR and how AIR development differs across technology choices.

Why Choose AIR?

As you do when designing any software product, technology choices should be driven by customer requirements.  Here are some of the customer requirements that would start to point me toward AIR

  • Daily use.  A customer will use your app frequently and is willing to install the application (an extra step compared to viewing a web page) because it is accessed often
  • Connected.  The application relies on data out in the cloud.  It’s probably multi-user or social in some way
  • Need for offline use.  If offline use is a requirement, this could be a big push to AIR (or google gears, or some other local storage technology)
  • File system access.  Will the ability to read / write files on the users local machine enhance the usability or experience of the product?

Now let’s move one click down to some of the technical advandages you gain when choosing AIR

  • Your product loads faster.  No SWF DL or HTML page load.  Your code is local and will boot up faster
  • Multiple ways to store data including
    • File system access.  can read / write files
    • SQLite database
    • normal “browser-like” approaches like cookies
  • Desktop notifications.  notify users when there is some sort of state change
  • Control over the window.  Removing the standard looking window chrome does a lot more than you think to enhance the look and feel of your app.  the window can even be transparent… ooooh :)

Using AIR with Different Technologies

Another very cool thing about AIR is that there are multiple ways to make use of the run-time depending on your background.

If you are a Flash developer, you can use your familiar Flash CS4 product to create AIR apps.  I know the least about this option, so I’ll move on…

If you are a Flex developer (like me!) you can build an AIR app in much the same way that you would build a normal Flex app.  You have an extended API at your disposal and the configuation of the app is slightly different.  This page does a nice job of explicitly listing out all the API differences between Flex development and AIR development.  I personally will gravitate toward this option since I think Flex provides a nicer development environment and UI capabilities than DHTML when we are talking about desktop experiences.  The other cool thing is that as long as you are careful, it should be easily possible to port an app between a pure Flex browser experience and an AIR desktop experience.

Last but surely not least is DHTML.  So for all you web standards lovers out there (and i consider myself among those ranks), you can translate all your HTML / JS / CSS skills straight to the desktop and create disconnected and/or file system aware experiences.  Pretty cool stuff!  DHTML development comes with a few caveats (not the least among them is that use of eval() is limited due to security concerns.  It is overcomable, but needs to be pretty intentionally designed).  I haven’t looked, but i suspect that there are probably some pretty good JS libraries out there to make DHTML + AIR development a snap.

Getting Started and References

So there is my 2c introduction to AIR and why i think it is a truly compelling platfrom.  It is, of course, not the the answer to every problem in the world; however, for a certain subset of applications, AIR is a wonderful addition to a developer’s toolkit.

To get started with AIR, head to this adobe page and follow the directions.  In the Meetup, I plan on exploring the the APIs around windowing (including notification mechanisms in the system tray or application bar) and file read/write capability.  Obviously there is much more available, but i have a feeling we’ll be pressed for time with just that.

While preparing, i used the following very helpful references

thanks and have fun with AIR!