Naked AIR

In my last post, I talked about the reality of packaging OpenLaszlo applications into AIR applications. It is pretty exciting that you can successfully package OpenLaszlo apps and install them on a desktop, and have that application function – i.e. make HTTP requests, execute JavaScript and load media. However my first experiment (the OpenLaszlo Weather demo app) didn’t really delve into any AIR APIs, such as being a chromeless application or working offline.

The next logical step was to make a chromeless application. From an end-user’s perspective, that means the application is not wrapped in the operating system’s standard window. Packaging an application without chrome is actually quite easy with AIR. What’s tricky from an OpenLaszlo developer’s perspective is to supply close and minimize buttons and enable dragging. All these actions require the developer to call AIR APIs that are not available to OpenLaszlo today. They execute in a different version of JavaScript from that which is present in OpenLaszlo 4.0. So you can’t call them directly; you have to create a bridge to them. I chose the Flex 3beta1 environment as a bridge, although I think you could use Flash CS3 to create the simple interface that is needed.

Just to make sure that the application was not lame, I threw in a dataset and had it connect to an HTTP service, do some replication, and load some media.

Anyway, here is a screenshot of my application:

Chromeless Screenshot

The screenshot is not very exciting, because you don’t see the rest of my desktop, so I’d highly encourage you to download the chromeless OpenLaszlo AIR application pictured above and install it yourself. Note that you must have the AIR runtime installed to install and run my application.

OpenLaszlo… Into Thin AIR

I’ve been hearing a lot about Adobe AIR (Adobe Integrated Runtime; formerly known as Apollo), so I decided to give it a try.

“What!” you say, “Isn’t Adobe AIR a product that threatens OpenLaszlo – the lifeblood of the company (Laszlo Systems) you work for?”

Actually, no. It turns out that Adobe AIR plays quite nicely with OpenLaszlo. You can take an OpenLaszlo application, and compile it to a .air installer. Your application can continue to function, just like it did via a browser. Only now, instead of having to fire up a web browser, the user can start the OpenLaszlo application from their operating system. There’s no download time involved. Here’s a shot of the OpenLaszlo Weather application running on my desktop:

Screenshot of OpenLaszlo in AIR

Here’s the OpenLaszlo AIR installer for the OpenLaszlo Weather application. To install this application on your desktop, you’ll need to download and install the AIR runtime. Note that the installer is zipped for portability.
I’ll post more detailed steps on how to create your own OpenLaszlo AIR applications soon.