Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
BEEFING UP AIRNative extensions in AIR 3.0
@WOUTER• Wouter Verweirder• blog.aboutme.be• Lecturer   @ HOWEST• Partner   @ Happy Banana• AS3NUI     / AIRKinect
SESSION OVERVIEW1. What is a native extension2. Build a native extension  1. Hello World  2. Working with AS Objects  3. T...
WHAT IS A NATIVE               EXTENSION?• Extend   the features of the AIR runtime ! • For TV,   Mobile, Desktop
WHAT IS A NATIVE EXTENSION?
WHAT IS A NATIVE EXTENSION?             Flex         ActionScript                     extension   AIR              AS3    ...
ANE FILE STRUCTURE              library.swf             catalog.xml                            extension.xmllibrary.swf   ...
ANE FILE STRUCTUREREGULAR SWC FILE
ANE FILE STRUCTUREANE FILE
WHY?• access   native platform specific code libraries• Re-use   legacy native code• Increase   performance (native perform...
WRITING AN EXTENSION• ActionScript: ExtensionContext    class• Native:  •C   entry point on Windows, OSX, iOS (& Android) ...
WRITING AN EXTENSION         adt    ane file
1. Create ExtensionContext object2. Look up link with native code in XML
3. Link the context initializer4. Link the native functions in the context initializer
5. Call a method in native code
extension initializer  context initializerfunction calls & events   context finalizer  extension finalizer
Demo Hello World
WORKING WITH AS OBJECTS• Construct   new AS3 Objects• Get AS3    Object Type• Get   / Set properties of AS3 Objects• Call ...
WORKING WITH AS OBJECTSSIMPLE DATA TYPES
WORKING WITH AS OBJECTSAS CLASS INSTANCES
WORKING WITH AS OBJECTSEXAMPLE:
ARRAY / VECTOR METHODS
BYTEARRAY / BITMAPDATA   acquirememory access   No other API methods are allowed here   release
BYTEARRAY / BITMAPDATA
BYTEARRAY / BITMAPDATAEXAMPLE:
Demo ByteArray Access
THREADING• Is   allowed in the native extension :-)• NO     FRE API calls allowed outside the main thread• except    for: ...
THREADING
Demo Threading
WHAT ABOUT ANDROID ?• C API   for Windows, OSX & iOS• Java Wrapper   for Android: • com.adobe.fre.FREExtension            ...
WHAT ABOUT ANDROID ? EXAMPLE:
WHAT ABOUT ANDROID ?  EXAMPLE:
WHAT ABOUT ANDROID ?EXAMPLE:
Demo Mobile UDP extension
PACKAGING AN ANE              library.swf             catalog.xml                            extension.xmllibrary.swf     ...
PACKAGING AN ANE1.Compile SWC of your AS3 code2.Unzip SWC file, get library.swf file3.Put swc, library.swf, extension.xml & ...
PACKAGING AN ANEadt -package -storetype pkcs12 -storepassp@ssw0rd -keystore key.p12 -tsa none -target ane HelloWorldExtens...
BUILDING APPS WITH ANE’S
BUILDING APPS WITH ANE’S
BUILDING APPS WITH ANE’S
AIRKINECT• Native   extension to use the Kinect in your AIR apps• Current   version: 1.7.1 • Full   skeleton Data • Camera...
Created By Tim Camerlinckx - http://vimeo.com/34614887
Created By Yannick Van der Goten - http://vimeo.com/34563640
Created By Laurents Laire - http://vimeo.com/34264122
Created By Simon Pertz - http://vimeo.com/34681243
AIRKINECT 2.0• Simplified API• New   features: • Skeleton   Joint Rotations • User    center-of-mass • Point   Cloud Region...
Time for some Kinect coding!
Questions(and hopefully some answers...)
Thank you!           @wouter   http://blog.aboutme.be   http://www.as3nui.comhttp://www.happy-banana.be
Beefing Up AIR - FITC AMS 2012
Upcoming SlideShare
Loading in …5
×

Beefing Up AIR - FITC AMS 2012

14,077 views

Published on

Presentation given at FITC Amsterdam 2012.

AIR has been the cross device platform to deploy interactive applications. This session shows you how you can extend the default capabilities and add native interaction and performance to your applications.

Published in: Technology, Education
  • Be the first to comment

  • Be the first to like this

Beefing Up AIR - FITC AMS 2012

  1. 1. BEEFING UP AIRNative extensions in AIR 3.0
  2. 2. @WOUTER• Wouter Verweirder• blog.aboutme.be• Lecturer @ HOWEST• Partner @ Happy Banana• AS3NUI / AIRKinect
  3. 3. SESSION OVERVIEW1. What is a native extension2. Build a native extension 1. Hello World 2. Working with AS Objects 3. Threading / Communication 4. What about Android3. Use a native extension4. AIRKinect extension5. Q & (hopefully) A
  4. 4. WHAT IS A NATIVE EXTENSION?• Extend the features of the AIR runtime ! • For TV, Mobile, Desktop
  5. 5. WHAT IS A NATIVE EXTENSION?
  6. 6. WHAT IS A NATIVE EXTENSION? Flex ActionScript extension AIR AS3 AS3 ... DLL JAR OS
  7. 7. ANE FILE STRUCTURE library.swf catalog.xml extension.xmllibrary.swf library.swf ...ext.dll ext.jar
  8. 8. ANE FILE STRUCTUREREGULAR SWC FILE
  9. 9. ANE FILE STRUCTUREANE FILE
  10. 10. WHY?• access native platform specific code libraries• Re-use legacy native code• Increase performance (native performance / threading)
  11. 11. WRITING AN EXTENSION• ActionScript: ExtensionContext class• Native: •C entry point on Windows, OSX, iOS (& Android) • Java entry point on Android
  12. 12. WRITING AN EXTENSION adt ane file
  13. 13. 1. Create ExtensionContext object2. Look up link with native code in XML
  14. 14. 3. Link the context initializer4. Link the native functions in the context initializer
  15. 15. 5. Call a method in native code
  16. 16. extension initializer context initializerfunction calls & events context finalizer extension finalizer
  17. 17. Demo Hello World
  18. 18. WORKING WITH AS OBJECTS• Construct new AS3 Objects• Get AS3 Object Type• Get / Set properties of AS3 Objects• Call AS3 Object methods
  19. 19. WORKING WITH AS OBJECTSSIMPLE DATA TYPES
  20. 20. WORKING WITH AS OBJECTSAS CLASS INSTANCES
  21. 21. WORKING WITH AS OBJECTSEXAMPLE:
  22. 22. ARRAY / VECTOR METHODS
  23. 23. BYTEARRAY / BITMAPDATA acquirememory access No other API methods are allowed here release
  24. 24. BYTEARRAY / BITMAPDATA
  25. 25. BYTEARRAY / BITMAPDATAEXAMPLE:
  26. 26. Demo ByteArray Access
  27. 27. THREADING• Is allowed in the native extension :-)• NO FRE API calls allowed outside the main thread• except for: FREDispatchStatusEventAsync
  28. 28. THREADING
  29. 29. Demo Threading
  30. 30. WHAT ABOUT ANDROID ?• C API for Windows, OSX & iOS• Java Wrapper for Android: • com.adobe.fre.FREExtension create instance of... • com.adobe.fre.FREContext returns collection of... • com.adobe.fre.FREFunction
  31. 31. WHAT ABOUT ANDROID ? EXAMPLE:
  32. 32. WHAT ABOUT ANDROID ? EXAMPLE:
  33. 33. WHAT ABOUT ANDROID ?EXAMPLE:
  34. 34. Demo Mobile UDP extension
  35. 35. PACKAGING AN ANE library.swf catalog.xml extension.xmllibrary.swf library.swf ...ext.dll ext.jar
  36. 36. PACKAGING AN ANE1.Compile SWC of your AS3 code2.Unzip SWC file, get library.swf file3.Put swc, library.swf, extension.xml & native builds (dll, ...) in one directory4.Run adt command
  37. 37. PACKAGING AN ANEadt -package -storetype pkcs12 -storepassp@ssw0rd -keystore key.p12 -tsa none -target ane HelloWorldExtension.aneextension.xml -swc helloworldas.swc -platform MacOS-x86 library.swfHelloWorld.framework -platform Windows-x86 library.swf HelloWorld.dll http://help.adobe.com/en_US/air/build/ WS789ea67d3e73a8b22388411123785d839c-8000.html
  38. 38. BUILDING APPS WITH ANE’S
  39. 39. BUILDING APPS WITH ANE’S
  40. 40. BUILDING APPS WITH ANE’S
  41. 41. AIRKINECT• Native extension to use the Kinect in your AIR apps• Current version: 1.7.1 • Full skeleton Data • Camera Streams: RGB & Depth • Point Cloud info
  42. 42. Created By Tim Camerlinckx - http://vimeo.com/34614887
  43. 43. Created By Yannick Van der Goten - http://vimeo.com/34563640
  44. 44. Created By Laurents Laire - http://vimeo.com/34264122
  45. 45. Created By Simon Pertz - http://vimeo.com/34681243
  46. 46. AIRKINECT 2.0• Simplified API• New features: • Skeleton Joint Rotations • User center-of-mass • Point Cloud Regions • IR Camera Stream
  47. 47. Time for some Kinect coding!
  48. 48. Questions(and hopefully some answers...)
  49. 49. Thank you! @wouter http://blog.aboutme.be http://www.as3nui.comhttp://www.happy-banana.be

×