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

 

 

 

 

, , , ,

  • http://www.madeinflex.com/2011/09/08/release-candidate-de-air-3-y-flash-player-11/ MadeInFlex » Blog Archive » Release Candidate de AIR 3 y Flash Player 11

    [...] link 1 link 2 Comparte: sociallist_4e8f1b2d_url = 'http://www.madeinflex.com/2011/09/08/release-candidate-de-air-3-y-flash-player-11/'; sociallist_4e8f1b2d_title = 'Release Candidate de AIR 3 y Flash Player 11'; sociallist_4e8f1b2d_text = ''; sociallist_4e8f1b2d_tags = '';           0 votos [...]

  • HB

    I’d like to see the AIR platform and plain SWF files being merged somehow, similar to how Silverlight OOB works, so APIs like Native Extensions could be used in normal SWF files when opened on the desktop. I guess it’s not gonna happen :/.

  • http://www.remotesynthesis.com/post.cfm/cool-stuff-with-the-flash-platform-9-8-2011 Cool Stuff with the Flash Platform – 9/8/2011 | Remote Synthesis

    [...] release of a new AIR 3 beta on Adobe Labs and Adobe evangelist Mark Doherty discusses some of the uses and history of the AIR 3 native extensions feature along with a simple example of how you use an existing native extension in a project. [...]

  • http://www.blog.rivellomultimediaconsulting.com/posts/considering-flash-to-mobile-development Considering Flash-To-Mobile Development

    [...] Adobe AIR 3.0 Native Extension – Explained! [...]

  • http://profiles.google.com/dadmyshitsays Sam Rivello

    WOW! This all sounds great. But how do we compare Flash-To-Mobile (AIR) vs Native (Objective-C) Development? And if we DO choose AIR, how do we decide to start with Flash or Flex?

    Here are two great articles!

    Great Article “Considering Flash-To-Mobile Development”
    http://www.blog.rivellomultimediaconsulting.com/posts/considering-flash-to-mobile-development

    Great Article “Flash-To-Mobile Dev: Flash vs. Flex”
    http://www.blog.rivellomultimediaconsulting.com/posts/flash-to-mobile-dev-flash-vs-flex

  • Anonymous

    I’m not sure what you mean exactly, but it does sound alot like the Captive runtime feature that we announced.

    Check this out:
    http://www.tricedesigns.com/2011/08/10/air-3-0-captive-runtime/

  • HB

    I talk about being able to use the AIR API from a normal SWF file when it is running in the desktop, instead of a webbrowser.
    Silverlight does it that way, you publish just one file to the web, from it the user can choose to install the application as an “out of browser” SL application, and that way the app get access to some features like the ones provided by AIR (although more limited in some areas), like accessing or creating some COM objects.
    In order to use those features you just check first if you are running out of the browser, and optionally you can also check if you are running with administrative privileges for some extra features.
    If the app is not installed, it can be still run in the browser anyway, but without those extra features, and limited to the browser sandbox.

  • Anonymous

    Ah, I think it’s clear that the Silverlight team made different choices around their security model.  With AIR it’s possible to install a SWF that can otherwise be presented and installed as a SWF on the web. 

    You can see an example of that here:
    http://www.flashmobileblog.com/radar/

    From the outset we wanted to enable developers to deliver HTML applications as well as Flash, and later to enable safe access to drag and drop, menus and toolbars etc.  Our goal was also to make this completely consistent across Windows, Mac and a range of other platforms while enabling the use of native code like C++. 

    I don’t think Silverlight had the same capabilities, their HTML support was only available in out-of-browser mode, nor did they support the use of native/legacy code components built in other languages.

    So indeed the design is different, but in my opinion the functionality presented in AIR demonstrates that Silverlights OOB mode was more of a hack than a feature.

  • HB

    Coincidentally, I have to look at Radar during this week. Once I finish doing so, I’ll post my thoughts, as the procedure you mention is unknown to me.

    I agree that the approach used by SL sucks in that they only thought of Windows, and looks more like a hack in some areas, however, I find the “out of browser” system to be somewhat more elegant, and easier to work with. Although, I think the “egocentricity” of Microsoft allowed them to gain a bit of attention in the world of bussiness applications for intranets, but I guess Native Extensions will make that advantage a little narrower (because of making AIR able to interact with Excel for example).

    Another thing the MS people got right, just IMHO, is the XamlReader class, it would be nice if Adobe would roll own some MxmlParser class instead of having to use third-party ones, or rolling your own.

    It would be nice to see some Native Extension example made in .Net/Mono.

  • http://twitter.com/alchymi ALCHYMI

    This is realy great .. 

    Any idea how to use Admob Native Ad system for APK ????

  • Anonymous
  • alfonso fonso

    hi, i’m looking for a bluetooth native extension… does anybody know where can i find it?

  • http://www.buywigonline.com Yesuifen20

    lt 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 “Stag

  • http://www.rapidsofttechnologies.com/android-application-development.html android app development

     Thanks for sharing this post I never knew this until I read this post.

  • Tyler A Gill

    Yeah I would also be really interested in android bluetooth native extension

  • http://www.iyoume.net ???

    Thank you for sharing. Very clear and useful for me. :)

  • Anthony

    Hi,
    I have just release a blog post about creating a NativeAlert extension for AIR. It includes multiple buttons and dispatches ActionScript events when the user selects one of those buttons. 
    the post can be found here.
    http://www.liquid-photo.com/2011/10/28/native-extension-for-adobe-air-and-ios-101/
    The source is on github and you can download the NativeAlert.ane file directly also 

    Hope you guys like it.

  • http://www.jacketoutletsales.com/ moncler jackets outlet

    Folks create their particular accomplishment by simply finding out their ambitions to learn and through training this right up until they will come to be great at the item. moncler outlet  and moncler jackets outlet

  • http://www.intellectsoft.net/ Mobile application development

    Native? That’s good, hope they will work fine otherwise I’ll stop using AIR 3 at all!

  • http://www.elantechnologies.com/services/mobile-apps/android-application-development/ Android Development

    There are good features of AIR 3 Native Ext. like deeper integration with target devices and maximum performance for critical code.

  • http://www.otssolutions.com/ OTS Solutions

    Thanks For such great post, i found this is great post on the internet
    and hope you keep it up regular

    Android Application Development