Archive for October, 2007

AIR is Desktop 2.0

As I was putting together an Introduction to AIR presentation yesterday, something struck me about AIR that I hadn’t fully realized before: AIR is desktop 2.0.

To me, web 2.0 means a new wave of innovation and attention to things like user experience. It’s not just the technology (Ajax, Flex, etc.) or things like user-generated content or social networks. Rather, it’s what all these things represent: a commitment to more effective, efficient, and engaging user experiences.

But why should such an important evolutionary step in application development be confined to the web? What about the desktop? In many ways, desktop applications have stagnated worse than pre web 2.0 applications. In general, they tend to be bloated, and it doesn’t seem to matter how fast my processor is or how much memory my computer has — most desktop applications seem to find a way to use just about all available resources. They have too many features that not enough people use, and since updates are such a big deal, bug fixes are few and far between. Worst of all, convention seems to have replaced innovation. Just like on the web, we have certain expectations of how desktop applications should work, and we tend to forget to demand more.

That’s not to say there hasn’t been any innovation on the desktop. OS X was a huge step forward, and although Windows Vista doesn’t represent any type of fundamental change in the desktop model, it’s certainly the nicest looking OS Microsoft has ever released. I finally installed Office 2007 the other day, and I was impressed with Microsoft’s obvious desire to break away from 17 years of user interface history in order to provide Office users with a more streamlined and intuitive experience.

So I believe the desire is there to create better desktop experiences, but not necessarily the tools. That’s where I think AIR is really going to shine. In fact, I believe that AIR is going to be the catalyst for desktop 2.0.

The reason I’m coming to this realization now is that I’ve had enough time to really see what AIR can do. Of course, there are the most salient examples like the new eBay Desktop and AMP, but there are a lot of other smaller, more subtle clues that foreshadow the types of experiences we have in store for us. The other day, I wrote an application called AIRPressure just to see how hard it would be to generated dynamic dock and system tray icons using Flash drawing APIs. The little timer that appears in the dock or system tray is being drawn completely dynamically, and is updated once per second. The application took about a day to write (mostly because I had to familiarize myself with the Flash drawing APIs and enough trigonometry to to draw a dynamic pie chart) and it works perfectly on both Mac and Windows. The app itself isn’t anything revolutionary, but the ease with which I was able to do something that has traditionally been difficult, and to do it in a cross-platform way, really starts to illuminate the possibilities.

My team has been working on an open source AIR notification framework and we decided the other day to see how far we could push it. Among many other things, the notification framework allows you show notification windows like "toasts" on Windows or the Google Notifier on Mac. Just for the fun of it, we decided to see if we could extend the AbstractNotification class and create a custom notification with a video in it. It took Prabs (an engineer on my team) about half a day to get it working beautifully, and most of his time was spent familiarizing himself with the Flash video APIs which he had never used before. (There’s a sample in the Google Code project — you just need an FLV on your machine to point the sample application to.)

And there are examples like the Allurent Desktop Connection, AOL’s Top 100 Video application, all the amazing apps built for the Adobe AIR Developer Derby, and one of my personal favorites, Snippage.

In developing AIR, it was easy to get caught up in specific AIR APIs, and to think of AIR’s capabilities in terms of those APIs. However, I’ve recently realized that those APIs don’t even come close to defining what AIR is and what it can do. AIR’s true capabilities lie somewhere in the intersection of all the breathtaking and innovative things millions of designers and developers can do with Flash, Flex, and Ajax, the power of desktop APIs, and the functionality unique to AIR like the embedded database. I think AIR is going to completely redefine our expectations of both developing for and interacting with desktop applications, and I think it’s going to far exceed even our own expectations.

Generating Dynamic Dock and System Tray Icons in AIR

Update (11/18/09): AIRPressure has been renamed to Timeslide. All links below have been update.

Someone asked me the other day if AIR applications can generate dynamic dock and system tray icons. The use case is something like Mail.app on Mac which always shows you the number of unread messages as part of the dock icon.

I’m happy to report that this is perfectly possible in AIR, and I created a sample application called AIRPressure to demonstrate. AIRPressure is a countdown timer which shows a dynamically generated timer icon in your dock or system tray to let you know how much time is left. It also has some other cool features:

  • It will optionally show a notification window when the timer is complete.
  • It will optionally open a URL in your browser when the timer is complete.
  • The dock icon bounces or the task bar icon flashes when the timer is complete.
  • All your settings are saved between uses.

The code for AIRPressure is probably more interesting than the application itself. For notifications (notification windows, bouncing the dock icon, flashing the task bar entry), and for changing the dock and system tray icons in a cross-platform manner, I use the as3notificationlib project that my team has been working on which makes it extremely simple. And for persisting preferences, I use the new as3preferencelib that my team also wrote which handles all file IO, encryption, and serialization automatically. AIRPressure is a pretty useful and comprehensive cross-platform application, and the entire app is only about 300 lines of code (thanks to all these libraries doing a lot of the heavy lifting).

Make Text Fade in Flash Without Embedding Fonts

My team is working on a notification framework for AIR. It provides a cross platform API for managing notification windows, changing the dock or system tray icon, attaching menus to the dock or system tray icon, and bouncing the dock or flashing the task bar icon. It’s open source and free, and available now on Google Code if you’re interested in an early preview.

One of the challenges we ran into was getting the notification text to fade along with the notifications. My first reaction was that we were going to have to embed a font which is how I have gotten text to fade in Flex applications in the past. However, I didn’t want to have to include a font in an open source project for both technical and legal reasons. Fortunately, one of the engineers on the AIR team (Stan Switzer) pointed me to one of the first AIR applications ever written called ApolloClock in which he had partially transparent dynamic text.

It turns out the answer is to apply a filter to the text. Applying a filter to a TextField results in the runtime generating a bitmap out of the device font which means you can change its alpha, rotation, etc. This was a huge help, and resulted in a very cool and smooth fade effect. It also allows the notification library to remain very small since it’s written in 100% ActionScript (no Flex), and now does not contain an embedded font. (It might also be possible to use cacheAsBitmap to make this work, but I was happy enough with the filter approach that I didn’t investigate further.)

I’ll post more about the notification framework as we add features. I’ll also post more about the application we’re working on that we wrote the notification framework for. It, too, will be be free and open source, and will make Mac users who have to use Exchange calendaring very happy.