What is new in Adobe AIR 2.6 ?

18Jun

Adobe AIR 2.6 is now live (runtime and SDK). The primary focus of 2.6 is to achieve feature parity between Android and iOS, however we did manage to sneak some good features in for the SDK, Android, and for the desktop profile, as well.

Here’s a list of everything that’s new in AIR 2.6.

Asynchronous Bitmap Decoding. This features allows bitmaps to optionally be decoded in another thread as opposed to on-demand in the main thread. Setting the imageDecodingPolicy property on a LoaderContext toImageDecodingPolicy.ON_LOAD enables asynchronous bitmap decoding which can keep your application more responsive and make animations much smoother.

Owned Windows. The use case for owned windows is primarily things like tool palettes. The owned window feature allows you to associate one NativeWindow with another so that the owned window is always above its owner in z-order. This was probably mostly possible before owned windows using things like activate events and the orderInBackOf, orderInFrontOf, orderToBack, and orderToFront APIs, but with owned windows, all you have to do is pass the owner of the new window in with the NativeWindowInitOptions object, and everything is handled for you. Much easier.

Bitmap Capture in StageWebView. The new drawViewPortToBitmapData function on StageWebView lets you draw the view port of a StageWebView 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 theStageWebView back when you’re ready.

Microphone support on iOS. The Microphone APIs now work on iOS.

StageWebView on iOS. Just like on Android, the StageWebView now works on iOS.

Multitasking on iOS. With 2.6, AIR applications will get activate and deactivate events on iOS as users switch to and from the app. AIR applications 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 for any application).

Retina Support on iOS. Pretty self-explanatory. 2.6 has support for the very high-resolution iPhone 4 and iPod touch screens (326 PPI), and the higher resolution application icons.

iOS Camera, CameraUI, and CameraRoll Support. The Camera and CameraUI APIs are now supported on iOS, just like on Android. (Be sure to read How to Use CameraUI in a Cross-platform Way if you going to use these APIs for apps that you want to run on both iOS and Android devices).

Improved hardware acceleration on iOS. Hardware acceleration on iOS now works like it does on Android, and generally provides much better performance than with PFI. And speaking of PFI…

PFI is now ADT. 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 apps. I should also mention that iOS applications (IPA files) can be built and copied to iOS devices on Windows using ADT and iTunes. Very slick.

Configurable panning with soft keyboard activation. When a text field receives focus in an AIR application on a mobile device, the soft keyboard is generally shown, and if the keyboard covers the text field, the UI is automatically panned so that the text field isn’t obscured. This behavior is now configurable. By default, nothing will change, but starting with 2.6, developers can use an application descriptor setting to override the default behavior. With <softKeyboardBehavior> set to none in the application descriptor, the UI will not automatically pan. Rather than using the default behavior, developers can listen for the softKeyboardActivating event on the Stage and use the softKeyboardRect property to modify their applications’ layout themselves.

Programmatic control of the display of the on-screen keyboard. Using the new requestSoftKeyboard()function on InteractiveObject, along with the needsSoftKeyboard andsoftKeyboardInputAreaOfInterest properties, developers can now have complete programmatic control over displaying the soft keyboard. (Note that these APIs are Android-only and not supported on iOS.)

Vector printing on Linux. If you can get your printer to work on Linux, you can now get vector printing in AIR. (Personally, I have terrible luck with printers on any OS.)

Native cursor support. This is a big one. If you’ve ever changed the cursor in Flash or Flex, you know there are several disadvantages like a noticeable performance hit, pauses in animated cursors due to CPU usage, and the fact that the custom cursor only works inside the AIR application (what’s really happening is that the native mouse cursor is being hidden, and a sprite is being rendered in its place which has to listen for MouseMoveevents to follow the invisible cursor). With AIR 2.6, developers have access to real native cursors. The newMouseCursorData class takes one or more bitmaps and a hotSpotPoint, and creates an actual native cursor.

On-device debugging over USB (Android only). No more wrestling with WiFi debugging. Mobile Android apps can now be debugged over USB.

Native Menu event refinement. This one is subtle, but important. Sometimes an application needs to dynamically prepare a NativeMenu before showing it in order to add, remove, or disable items. That’s what theEvent.DISPLAYING event is for. But a NativeMenu can be used without it actually being displayed as in the case of key equivalents being associated with NativeMenuItems. If a user is interacting with a NativeMenuusing the keyboard, no displaying event is thrown which means that the code never has the opportunity to dynamically change the menu. That’s what the new Event.PREPARING event is for. A preparing event is thrown before a NativeMenu is displayed, and before it is accessed with a keyboard shortcut, making it somewhat more generic than a displaying event. I would recommend using Event.PREPARING from now on in case you ever decide to add keyboard shortcuts to your menus.

Enhanced text support on Android. Another big one. AIR 2.6 has support for scrolling, text selection, and text context menus (for cut/copy/paste) on Android.

NetConnection.httpIdleTimeout. In AIR 2, we added the URLRequest.idleTimeout andURLRequestDefaults.idleTimeout properties. In AIR 2.6, we’re adding similar support to NetConnectionwith the new httpIdleTimeout property.

Bundled Android USB drivers on Windows. Mac users can just connect their Android devices and start copying files and/or debugging right away. Windows users need to install Android USB drivers first. The AIR 2.6 SDK will have Windows USB drivers for most Android devices bundled to make this process much easier.

Support for the vipaccess:// URI. The vipaccess:// URI for invoking VeriSign’s VIP Access application is now white-listed in AIR.

-version flag for ADT. Running ADT with the -version flag will now return the version of ADT.