July 02, 2008

Closing all your application windows in AIR

Here's a little snippet of code I sometimes use in AIR applications to make sure all windows close when the main application window closes. I usually put it in the main application MXML file (the main window of the application). It stops the main window from closing, and closes any other opened application windows first in the opposite order in which they were opened (more recent windows first). Without code like this, if you have any other windows open, even little utility windows, and your main application window is closed, your application will not exit, even if NativeApplication.autoExit is set to true.

this.nativeWindow.addEventListener(Event.CLOSING,
  function(e:Event):void
  { 
    e.preventDefault();
    for (var i:int = NativeApplication.nativeApplication.openedWindows.length - 1; i >= 0; --i)
    { 
      NativeWindow(NativeApplication.nativeApplication.openedWindows[i]).close();
    } 
  });

Posted by cantrell at 09:28 AM. Link | Comments (1) | References

June 16, 2008

AIR 1.1 and Apprise 1.5

With the release of AIR 1.1 comes a new version of Apprise, a feed aggregator written for AIR. Apprise is a work in progress with lots of additional features to come, but here's what we have so far:

  • Support for all versions of RSS and Atom.
  • Automatic categorization by author and topic.
  • OPML import and export.
  • Realtime search.
  • "Site view" (easily switch between the summary, and the site itself).
  • Check marks. Put a check mark next to posts that you want to keep track of and easily find again later.
  • Advanced sorting. Sort feeds, authors, and topics by name, or by number of unread posts.

Apprise 1.5 adds the following features:

  • Support for 11 languages. Apprise now supports German, English, Spanish, French, Italian, Japanese, Korean, Portuguese, Russian, Simplified Chinese, and Traditional Chinese. By "support" I mean the UI is localized into these 11 languages — the aggregator itself will support any written language.
  • Automatic feed resolution. Rather than entering a feed URL, you can now enter a site URL, and Apprise will automatically find and aggregate the feed associated with it.
  • Improved search. The search algorithm in Apprise 1.5 is much more advanced. Both the title and the summary are searched, and you can search for multiple terms in any order.
  • Improved "new post" heuristics. Apprise 1.5 is more intelligent about figuring out which posts are new in order to eliminate duplicates.
  • General polish. We added several little improvements like focusing the cursor where appropriate, and updating individual feeds' unread count during the aggregation process rather than updating them all at the end.

If you check the code out and build Apprise yourself, you can get even more features:

  • Copy support. You can copy post URLs to our clipboard for easy sharing.
  • Drag and drop. Drag posts into an IM or email window to share stories.
  • Vi keys. Well, J and K, anyway.

My new intern, Daniel Koestler, and I will be working on adding new features to Apprise this summer. And, of course, it's all cross-platform and open source, so anyone who wants to contribute features can.

The next version of Apprise (2.0) will enable the auto-update feature so you'll be able to pick up new features automatically. We consider 1.0 and 1.5 to be betas, so they have to be manually installed. Click on the badge below to have a look at what we have so far, and let us know in the comments what features you want to see next.

AIR Badge

Posted by cantrell at 08:38 AM. Link | Comments (2) | References

May 13, 2008

Adobe Feeds Update II

Just a quick note to let you know that I fixed the Adobe Feeds web services. Also, just a reminder that if you're seeing "header length too long" error messages, clear your cookies, and the problem won't come back.

Oh, I also fixed the FAQ on Safari, so if you Mac users have been dying to read the FAQ all these years, now you can. Of course, you probably figured out the answer to your question by now.

Posted by cantrell at 11:30 AM. Link | Comments (6) | References

May 08, 2008

Adobe Feeds Update

The new launch of Adobe Feeds (MXNA) has gone well, but there are two issues I'm seeing people report:

  1. Maybe people have been getting "Header Length Too Large" errors. Interestingly, this comes from cookie-related code that CF7 tolerated, but CF8 doesn't. Anyway, the problem has been fixed. If you're still seeing the error message, clear your feeds.adobe.com cookies, and it will never come back.
  2. It seems the web services are broken. This is probably the result of the query optimizations I made. I didn't test all the web services, so they're probably incompatible with the changes I made. Oops. Sorry about that. I'll get this fixed in the next couple of days, and report back when they're working again.

We'll get Feeds back to 100% in the next week or so. Please be patient with us!

Posted by cantrell at 09:33 AM. Link | Comments (8) | References

May 05, 2008

The new MXNA (AXNA?)

First, I personally apologize for the downtime. We've been meaning to find MXNA a new home for quite a while now, and we finally decided to make the time to do it. Ironically, as we were working on moving the code over to the Adobe cluster, the old weblogs server went down in a big way. We're still not sure what happened, but for some reason, Java was core dumping a few minutes after starting JRun. Rather than spending too much time fixing the old server, we decided to look ahead, put up an "under construction" page, and focus on the new platform.

Mike Chambers and I wrote MXNA five years ago, thinking we would aggregate a few dozen popular blogs. 100 at the most. We initially put it on our own server which we expensed every month. When we outgrew that, we moved it to a single Macromedia server which Mike and I managed entirely ourselves. That worked out well for a couple of years until we outgrew it, as well. By that time, we were Adobe — a much larger company with more infrastructure — so moving it over to the cluster was a fairly involved task.

But we didn't just spread MXNA across a few more servers. As we began approaching 2,000 feeds, it became clear that the same code that managed 100 feeds wasn't doing such a good job managing 1,800. So I finally set aside a day, installed CF8, imported the production database, and with some pointers from Ben Forta (I'd never even used CF8 before — I've been focusing on AIR for the last two years), started optimizing.

I spent most of my time rewriting queries, and working on reducing the number of queries per request. The most dramatic change I made was optimizing the search query which went from about 30 seconds to one or two. Be sure to give it a try.

Again, sorry not just for the recent downtime, but for all the intermittent downtime over the last year or so. Hopefully we're past all that, and MXNA (AXNA?) will become a valuable community resource again.

Posted by cantrell at 09:08 PM. Link | Comments (22) | References

April 28, 2008

Weekend update to Newsbrew

A couple weeks ago, I blogged about a Google App Engine news aggregator I wrote called Newsbrew (original post). A few days later, Google announced the availability their RESTful feed API. Since the trickiest part of Newsbrew was the aggregation code, I decided to refactor the application to use Google's new service.

Newsbrew still stores feed and post data, but rather than retrieving and parsing the feeds myself (a surprisingly complex and error-prone process), Newsbrew now uses Google's REST feed API. All data, regardless of the underlying syndication format, is returned in a nice normalized JSON format.

With just a few hours of work, I was able to make Newsbrew much more robust, and because I no longer have code for parsing nine different formats of RSS and Atom, Newsbrew is much less error prone, and the code base is simpler.

I also added Ajaxian to the blogroll at the request of Dion Almaer. If you know of any other sites I should add, let me know.

Posted by cantrell at 11:32 AM. Link | Comments (1) | References

April 23, 2008

The latest version of PixelPerfect (with screencast)

PixelPerfect is a simple AIR application for measuring things on your desktop. If you want to see how it works, check out this screencast. If you want to see the code, check out the PixelPerfect Google Code project. And finally, if you just want to install it, click on the badge below.

AIR Badge

Posted by cantrell at 09:12 AM. Link | Comments (3) | TrackBack (0) | References

April 18, 2008

Newsbrew is now a Google Application

I wrote a news aggregator a couple of years ago called Newsbrew which I primarily used for my own news-reading needs. I think I took it down when I got tired of paying for the server, and worrying about keeping it up.

After Google launched the Google App Engine, I decided to take a little break from Flex and AIR and rewrite Newsbrew in Python to get a good feel for the GAE experience. You can see the current beta version here.

Overall, I was very pleased GAE. It took me about five days to write this version of Newsbrew, but that included learning Python, Django, and everything about GAE. The application is fairly comprehensive, consisting of a user interface, aggregation service, and a secure administrator section. Unfortunately, I didn't get to all the features and bug fixes that I wanted, but the app still seems to work reasonably well.

It's still going to be a little while before we're writing real-world production apps on GAE as it still has several rough patches, bugs, and missing functionality. But it's very clear where Google is going with this, and there's no doubt that GAE is a very powerful concept and platform. I'm certainly going to keep my eye on GAE, and use it as much as I can.

Posted by cantrell at 11:16 AM. Link | Comments (2) | References

April 09, 2008

Maptacular 2.0: a desktop mapping application for AIR

Maptacular was one of the first applications I wrote for AIR. The first version parsed vCards from your local file system, and let you map the addresses it found inside. That was back when AIR was in still in alpha, so I didn't have APIs for things like drag and drop or copy and paste. Now that AIR 1.0 has shipped, I decided to rewrite Maptacular to to have the functionality that I originally envisioned.

I created a screencast of Maptacular 2.0 which you can watch here. If you want to install the app, just click on the badge below. If you want to see the source, it's all available on Google Code.

Maptacular is a good example of the following:

  • Custom chrome with transparency.
  • Custom application menus (implemented for the Mac only -- when Maptacular runs on Windows, there are no application menus).
  • Context menus.
  • Drag and drop.
  • Copy and paste (system clipboard access).
  • Yahoo! Maps for ActionScript 3 (with custom markers).
AIR Badge

Posted by cantrell at 09:43 AM. Link | Comments (3) | TrackBack (0) | References

April 02, 2008

Lineup: an Exchange calendar viewer for AIR

I did a screencast of an Exchange calendaring application I wrote for AIR. Click here to watch it.

It's one of the most useful applications I've written so far, and probably the most popular within Adobe. It lets you view your Exchange calendar, and it notifies you of upcoming meetings. It also works offline, so you can view your calendar and get meeting details while you're between internet connections.

Lineup uses all the following open source ActionScript 3 libraries:

  • as3corelib: various utilities like advanced date parsing.
  • as3exchangelib: talks to Exchange servers.
  • as3nativealertlib: a modal alert that appears in its own native window.
  • as3notificationlib: creates notification windows, and provides a layer of abstraction on top of OS-specific notifications.
  • as3preferenceslib: manages application preference persistence, including encryption when necessary.

The complete source code for Lineup itself is also available on Google Code, or you can simply click on the badge below to install it.

AIR Badge

Posted by cantrell at 09:39 AM. Link | Comments (10) | References