Posts Tagged iOS

AIR 3 Native Extensions

 

Yesterday we pushed out the first Release Candidate of AIR3 and Flash Player 11, and with that, we’ve outed another new feature of AIR – Native Extensions.  This represents a further opening up of the Flash Platform in that you will finally be able to add new features to the runtime.

History of Native Extensions

The origin of Native Extensions actually goes back all the way to Flash Lite in 2005 and were in fact part of my first engineering project at Adobe.  Back then we had the idea to enable a man machine interface (MMI) to the Flash Lite runtime to enable complete device interfaces to be built in Flash, the Samsung D600/D900, LG Prada, LG Cookie etc were the result of that effort .

The feature later evolved to become part of an OEM runtime called Adobe Mobile Client which was integrated into the BREW MP Platform to enable low-end devices to be produced with advanced interfaces and at much lower cost.

More recently we started working on “StageCraft”, the code name for a project to bring AIR/Flash support to the TV ecosystem.  With the first iteration it was apparent that remote controls were all different, it would be impossible to create a completely consistent API for all of the various pieces of consumer electronics out there.  With that, Native Extensions were reborn and redesigned to enable OEMs to build these custom APIs with ease.

Which brings us to today’s announcement, the opening of the Native Extension feature for all to use.

What are Native Extensions for?

From a high level this feature enables you to:

  • Achieve deeper integration with target devices
  • Incorporate legacy native code in your applications
  • Achieve maximum performance for critical code

As I see it, we built the Native Extension feature originally to enable access to platform or device specific features that don’t form part of the platform today.  Just to give you some context here, we always have debates about adding new features in the runtimes, many are community sourced, some OEM focused and some are internal like Flex etc.  Imagine what happens when the Acrobat, Photoshop and Runtime engineers are free to finish their pet projects :-)

Here are some thoughts on deeper API possibilities for devices today:

  • Notifications
  • Gyroscope
  • Bluetooth
  • Advertising
  • NFC / Payments
  • USB Accessories
  • Media FX/Encoding
  • Text to Speech
  • Contacts
  • Calendar
  • Alarms

Of course let’s not ignore the various possibilities that are now open for desktop developers that want to access provide new interfaces for legacy products.

The benefit is that now customers conversations shouldn’t end with “Can you support XX with AIR on XX platform?”, from this point on the answer will always be yes, assuming you have the technically capability to implement it, or can acquire the extension from someone who can.

Using a Native Extension

From Actionscript, the use of an already built Native Extension couldn’t be simpler.  In the example below you can see the first iteration of the Native Extension that I’ve been creating for Android Tablets with multiple displays.

            import flash.external.ExtensionContext;
            if(!extensionContext)
            {
                extensionContext = ExtensionContext.createExtensionContext("com.android.MultiDisplayInfo", "");
                return extensionContext.call("getInfo","getCount") as int; 
            }

 

Get Started

 

 

 

 

, , , ,

30 Comments