November 19, 2009

Which Storage Devices Are Considered Removable?

AIR 2 has the ability to detect the mounting and un-mounting of storage volumes like flash drives, hard drives, some types of digital cameras, etc. (to see this in action, see A Demonstration of the New Storage Volume APIs in AIR 2). This feature basically piggybacks off of the operating system's detection of storage devices. In other words, if the OS thinks something is a mass storage device, AIR will also recognize it as such and throw a StorageVolumeChangeEvent. If the OS does not recognize the device as a storage volume, AIR will not react to it. (Note: it is possible to detect and communicate with any type of peripheral in AIR 2 using external processes launched with the new NativeProcess API; the StorageVolume APIs are only for, well, storage volumes.)

Continue reading "Which Storage Devices Are Considered Removable?"

Posted by cantrell at 12:56 PM. Link | Comments (1)

November 18, 2009

Demonstration of Gesture APIs in AIR 2

I don't have a multi-touch computer (yet), but I do have a MacBook with a multi-touch trackpad which means I can write AIR 2 applications that incorporate gestures. The video below demonstrates a few of the new gesture APIs in AIR 2:

The code below shows how to indicate that you want to receive gesture events (as opposed to multi-touch, or no touch events at all), and registers for zoom, rotate, and pan gesture events (the watch variable refers to a Sprite which contains the bitmap image of the watch):

Multitouch.inputMode = MultitouchInputMode.GESTURE;
watch.addEventListener(TransformGestureEvent.GESTURE_ZOOM, onZoom);
watch.addEventListener(TransformGestureEvent.GESTURE_ROTATE, onRotate);
watch.addEventListener(TransformGestureEvent.GESTURE_PAN, onPan);

The three functions below show responding to each of the gesture events:

private function onZoom(e:TransformGestureEvent):void
{
    var watch:Sprite = e.target as Sprite;
    watch.scaleX *= e.scaleX;
    watch.scaleY *= e.scaleY;
}

private function onRotate(e:TransformGestureEvent):void
{
    var watch:Sprite = e.target as Sprite;
    watch.rotation += e.rotation;
}

private function onPan(e:TransformGestureEvent):void
{
    var watch:Sprite = e.target as Sprite;
    var watchBitmap:Bitmap = watch.getChildAt(0) as Bitmap;
    watchBitmap.x += e.offsetX;
    watchBitmap.y += e.offsetY;
}

For much more information on how multi-touch and gestures work in both AIR 2 and Flash Player 10.1 (including OS and hardware support, which gestures are supported where, and a thorough review of the APIs), and to download sample code, see Multi-touch and Gesture Support on the Flash Platform. Or, if you just want to see the code for this sample, you can download it here.

Posted by cantrell at 6:50 AM. Link | Comments (2)

November 16, 2009

AIR 2 Public Beta Resources

The AIR 2 public beta is now live! Below are all the links you'll need to learn more and get started:

Adobe Labs

Adobe Developer Center

Adobe TV

This Blog

Community

Posted by cantrell at 8:51 PM. Link | Comments (1)

November 13, 2009

A Demonstration of Encrypted Socket Support in AIR 2

I've been wanting to write my own email notifier in AIR for a long time, but without support for encrypted sockets, it wasn't easy to do. But now that AIR 2 added the new SecureSocket class, I was able to write a pretty functional email notifier in just a couple of days:

Continue reading "A Demonstration of Encrypted Socket Support in AIR 2"

Posted by cantrell at 7:20 AM. Link | Comments (4)

November 12, 2009

A Demonstration of the NativeProcess APIs in AIR 2

SearchCentral uses the new NativeProcess APIs in AIR 2 in order to integrate with Spotlight and provide very fast local file system search. Here's a demo:

Continue reading "A Demonstration of the NativeProcess APIs in AIR 2"

Posted by cantrell at 7:25 AM. Link | Comments (6)

November 11, 2009

A Demonstration of the New Storage Volume APIs in AIR 2

Below is a screencast of an application I wrote called FileTile in order to validate the new storage volume APIs in AIR 2:

Continue reading "A Demonstration of the New Storage Volume APIs in AIR 2"

Posted by cantrell at 6:52 AM. Link | Comments (0)

November 4, 2009

A Demonstration of the ServerSocket API in AIR 2

In order to validate the new ServerSocket APIs in AIR 2, I wrote an application called HTTPeek. HTTPeek is a proxy server that sits between your browser and the network, and can show you HTTP request and response headers. It can handle compressed content, chunked content, binary content, etc. Check out the video below to see it in action:

Continue reading "A Demonstration of the ServerSocket API in AIR 2"

Posted by cantrell at 8:20 AM. Link | Comments (9)

November 3, 2009

Some Interesting AIR Marketplace Statistics

A little over a year ago, I wrote a Python script to screen scrape the entire Adobe AIR Marketplace, download all the listed AIR applications, crack open the installers, and extract some statistics. My primary interest was how many HTML-based AIR applications were listed versus SWF-based applications, but I recorded some other interesting stats, as well.

I ran the script again the other day (after some updating since screen scraping scripts always break), and here's what I found:

Continue reading "Some Interesting AIR Marketplace Statistics"

Posted by cantrell at 7:54 AM. Link | Comments (5)

October 30, 2009

A Screencast Explaining and Demoing File Promises

File promises are kind of a difficult concept to describe, so I decided to explain them using a video. Hopefully this clarifies what file promises are, and why it's such a cool new feature of AIR 2.0:

Continue reading "A Screencast Explaining and Demoing File Promises"

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

October 29, 2009

Exhaustive List of Everything That's New in AIR 2.0

This morning, I was going to start making videos demoing some of the new features in AIR 2.0 when I realized that I should probably start with a list of everything that's new. Below is an exhaustive list of everything that we're planning on including in AIR 2.0. I use the word planning because even at this relatively late stage, things can change. Consider yourself warned.

Feel free to post questions in the comments.

Continue reading "Exhaustive List of Everything That's New in AIR 2.0"

Posted by cantrell at 10:44 AM. Link | Comments (43)