20
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Native Extensions Immanuel | Platform Evangelist http://blog.inoel.in Twitter: @immanuelnoel

Native extensions webinar

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Native extensions webinar

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Native Extensions Immanuel | Platform Evangelist

http://blog.inoel.in Twitter: @immanuelnoel

Page 2: Native extensions webinar

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 2

Why Native

Extensions

Understand Native

Extensions

See sample ANE’s in

use

Agenda

Page 3: Native extensions webinar

© 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

Page 4: Native extensions webinar

© 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

Page 5: Native extensions webinar

© 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

Page 6: Native extensions webinar

© 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

Page 7: Native extensions webinar

© 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

Page 8: Native extensions webinar

© 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!

Page 9: Native extensions webinar

© 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

Page 10: Native extensions webinar

© 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)

Page 11: Native extensions webinar

© 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

Page 12: Native extensions webinar

© 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

Page 13: Native extensions webinar

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Workflow 1 – Import the ANE

13

Flex

Bui

ld P

ath

Add ANE

Page 14: Native extensions webinar

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Workflow 2 – Ensure ‘Package’ is selected

14

Build

Pac

kagi

ng Package

Page 15: Native extensions webinar

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Workflow 3 – Write code

15

Accessing ANE classes with ActionScript APIs

Page 16: Native extensions webinar

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Workflow 4 – Modify Application Descriptor

16

Page 17: Native extensions webinar

© 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

Page 18: Native extensions webinar

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 18

Let’s see some action !

Using ANEs with Flash Builder

Page 20: Native extensions webinar

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Shoot your Questions !

Immanuel Noel http://blog.inoel.in

Twitter: @immanuelnoel