21 March 2011
This article is intended for Adobe AIR developers who are familiar with ActionScript 3.
All
Almost a year ago, Adobe stopped development on AIR for iOS due to a change in Apple's developer program license. Instead, we began focusing very heavily on Android. The result was AIR 2.5 which brought not only most of the existing AIR APIs to Android devices, but several new APIs, as well. When Apple removed the restrictions late last year, we were therefore in the very strange position of having our iOS and Android versions of AIR almost a full version out of sync.
Although there are several desktop features in AIR 2.6, the primary theme is bringing the Android and iOS releases back into alignment. This article outlines all the new features and APIs available in AIR 2.6 on iOS.
It's worth emphasizing how unusual the circumstances were that led to our iOS and Android releases being out of step, and that it isn't an issue that we take lightly. As soon as we decided to continue development on iOS, we put together a plan to get back to feature parity between the two platforms, and we fully intend to keep our platforms synchronized from now on.
In the desktop version of AIR, we bundle WebKit in order to power HTML-based applications, and to allow Flash applications to embed an HTMLLoader for displaying HTML content and executing JavaScript. For mobile versions of AIR, we don't bundle our own version of WebKit, primarily in order to keep the size of the runtime down. Instead, we added the StageWebView API. StageWebView uses the system web control provided by the operating system so that we don't have to bundle our own renderer and JavaScript engine. Version 2.5 added StageWebView support for Android, and AIR 2.6 adds support for iOS.
The new drawViewPortToBitmapData function on StageWebView lets you capture the view port of a StageWebView and draw it to a bitmap. This feature has two primary use cases. The first and most obvious is the ability to grab a "screen capture" of the StageWebView, and the second (related) use case has to do with positioning Flash content on top of a StageWebView. Since it's not possible to position Flash content on top of a StageWebView (Flash content is always drawn below), taking a snapshot of the content lets developers swap the StageWebView out for a bitmap when you need to position Flash content on top of it, then swap the StageWebView back when you're ready.
AIR 2.6 adds support for the Microphone class on iOS.
AIR 2.6 adds support for the Camera class on iOS.
The CameraUI class lets users use the default camera application on their devices to takes pictures and capture video. We added the CameraUI class in AIR 2.5 for Android, and AIR 2.6 brings it to iOS.
The CameraRoll class enables saving images to, and loading images from, a device's photo gallery. We added the CameraRoll class in AIR 2.5 for Android, and AIR 2.6 brings it to iOS.
With AIR 2.6, developers can optionally take advantage of the high-resolution iPhone and iPod touch 4 screens (retina displays). If developers opt in to the higher resolution screen, APIs like Stage.stageWidth, Stage.stageHeight, and Capabilities.screenDPI will be adjusted accordingly. In addition, the AIR SDK now supports the higher resolution 114x114 icons for the home screen.
With 2.6, AIR applications will get activate and deactivate events on iOS as users switch to and from the application. AIR apps will also be properly resumed rather than restarted (unless the OS has decided to kill it for some reason, which both iOS and Android reserve the right to do).
The PFI (Packager for iPhone) utility is gone, and its functionality has been integrated into ADT. ADT can now be used to package AIR files, native desktop installers, Android applications, and iOS applications. I should also mention that iOS applications (IPA files) can be built and copied to iOS devices on Windows using ADT and iTunes.
Now that AIR for iOS and AIR for Android are back in sync, it's time for developers to start building true multiscreen applications. Here are some resources to help you get started: