Upload
immanuelnoel
View
3.089
Download
0
Embed Size (px)
DESCRIPTION
Citation preview
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Native Extensions Immanuel | Platform Evangelist
http://blog.inoel.in Twitter: @immanuelnoel
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 2
Why Native
Extensions
Understand Native
Extensions
See sample ANE’s in
use
Agenda
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Mobile Apps with Adobe AIR
3
• Build for multiple platforms with the same competencies
• Mobile optimized components
• UI’s tailored for different form factors
• Host of Native APIs supported
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
The Missing Piece
4
Taking advantage of devices with advanced capabilities Eg. NFC Capable devices Harnessing faster processing for specific tasks The need to rewrite legacy code
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
An Ideal Solution
5
• Native APIs available to the ActionScript developer as an ActionScript API
• Minimal effort in porting these ActionScript APIs to other AIR applications which also need to access the same capabilities
• Minimal effort to extend these ActionScript APIs to other platforms which also provide the same capabilities
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
The Answer - ANE
6
P.S., ANE = Actionscript Native Extensions
• Build new Features into the AIR Runtime
• Go beyond the commonly used APIs
• Achieve deeper integration with target devices
• The way an Actionscript developer would like
it to be
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Native Extensions – As Developers See It
7
Same interfaces across platforms Use the same ActionScript APIs to access similar Native APIs across multiple platforms.
Reuse Legacy Code • Physics engines or game engines
• Image or video filters
• PDF rendering
Achieve native performance for specific tasks • Physics engines
• Image Encoding / Decoding
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Native Extensions – Deployment Models
8
Application Bundled Contains platform specific implementations for multiple platforms, and optionally the simulator, with each ANE bundled with every application that uses it.
Device Bundled Typically created by the manufacturer. Implementation is bundled along with the device.
We are speaking about the Application Bundled ANEs today!
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
ANE Structure
9
Coordinating application and presentation logic
Flash / Flex Application
Native Code ActionScript Library
Providing deep integration, legacy code reuse, and
performance
AN
E
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
The code that goes in…
10
Platform Form
Android Java Archive (.jar) or shared library (.so)
iOS Static library (.a) OS X Framework (.framework) Windows Dynamic Link Library (.dll)
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
ANE’s are…
11
• Re-Usable Software Components
• Defines an ActionScript API
• Can be developed and distributed independent of applications
• Are added at development time to applications that use them
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Using ANE’s…
12
• Flash Builder provides a well defined workflow
• As simple as accessing methods in another class
var vibrate:Vibrate = new Vibrate(); vibrate.doVibration(3000);
• Define Permissions
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Workflow 1 – Import the ANE
13
Flex
Bui
ld P
ath
Add ANE
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Workflow 2 – Ensure ‘Package’ is selected
14
Build
Pac
kagi
ng Package
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Workflow 3 – Write code
15
Accessing ANE classes with ActionScript APIs
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Workflow 4 – Modify Application Descriptor
16
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Sample ANEs
17
AS3C2DM - Android Lets you create custom push notifications for your Android applications.
Licensing - Android Shows you how to package the native extension for Android licensing.
Notifications – Android / iOS Lets you create notifications in AIR apps you deploy to Android and iOS.
Find the full list here : http://www.adobe.com/devnet/air/native-extensions-for-air.html
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 18
Let’s see some action !
Using ANEs with Flash Builder
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Where Next
19
Adobe DevNet Creating / Using / Sample ANE’s
http://www.adobe.com/devnet/air/ native-extensions-for-air.html
A community led site to provide a single central resource for
downloading Native Extensions for Adobe AIR http://extensionsforair.com/
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Shoot your Questions !
Immanuel Noel http://blog.inoel.in
Twitter: @immanuelnoel