43
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Michaël Chaize | Flash Platform Evangelist Develop mobile applications with Flex

Develop mobile applications with Flex

  • Upload
    confoo

  • View
    4.685

  • Download
    2

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Develop mobile applications with Flex

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

Michaël Chaize | Flash Platform Evangelist

Develop mobile applications with Flex

Page 2: Develop mobile applications with Flex

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

Menu du jour

2

Flex & Flash on mobileLive coding for AndroidMobile APIsFlex, Java and Real-timeResources

Page 3: Develop mobile applications with Flex

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

Adobe Flex

3

Page 4: Develop mobile applications with Flex

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

Flash Builder IDE

Flex SDK

Flex Class Library

MXML ActionScript

Compile

SOAP HTTP/S AMF/S RTMP/S

Web Server

Existing Applications & Infrastructure

J2EE Application Server

Adobe Data ServicesXML/HTTP

REST

SOAP Web Services

Browser

Flash Player

4

Adobe Flex basics

Page 5: Develop mobile applications with Flex

OLD COMPONENT MODEL

FLEX FRAMEWORK 3

GraphicsLayoutAnimationPartsStatesBehaviorLogicData

Component / Skin

Page 6: Develop mobile applications with Flex

SPARK COMPONENT MODEL

FLEX FRAMEWORK 4

ActionScript MXML

GraphicsLayout

AnimationParts

States

Component Skin

CSS properties

BehaviorLogicData

Page 7: Develop mobile applications with Flex

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

First-class interfaces

Page 8: Develop mobile applications with Flex

Flex on mobile ?

Page 9: Develop mobile applications with Flex

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

Technologic partners

Open Screen Project

Content providers

Page 10: Develop mobile applications with Flex

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

Flash Player 10.1

Flash Player 10.1

Google TV

Page 11: Develop mobile applications with Flex

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

Adobe AIR 2.5 = native applications = multiple screens

Page 12: Develop mobile applications with Flex

© 2010 Adobe Systems Incorporated. All Rights Reserved.

Native Applications

iOS

NativeApp

NativeApp

NativeApp

NativeApp

NativeApp

NativeApp

?

Page 13: Develop mobile applications with Flex

© 2010 Adobe Systems Incorporated. All Rights Reserved.

Adobe runtimes (Flash & AIR)

Abstraction Layer

iOS

Flex Application

?READY READY2011 soon soon

Page 14: Develop mobile applications with Flex

© 2010 Adobe Systems Incorporated. All Rights Reserved.

Flex “Hero”

Page 15: Develop mobile applications with Flex

© 2010 Adobe Systems Incorporated. All Rights Reserved.

Mobile Applications in "Hero"

15

s:TabbedMobileApplication s:MobileApplications:Application

Page 16: Develop mobile applications with Flex

© 2010 Adobe Systems Incorporated. All Rights Reserved.

<s:MobileApplication> life cycle

16

views.ListEmployees views.DetailsEmployee views.ListEmployees

DATA DATA

persisted in memory

subset

view destroyed view created

view destroyed view created

“BACK” bu�on

Page 17: Develop mobile applications with Flex

© 2010 Adobe Systems Incorporated. All Rights Reserved.

ActionBar

<s:View xmlns:fx=http://ns.adobe.com/mxml/2009 … title=”Expenses"> <s:navigationContent> <s:Button icon="@Embed('assets/home.png')"/> </s:navigationContent> <s:actionContent> <s:Button label=”+"/> </s:actionContent></s:View>

17 3

navigationContent titleContent actionContent

Page 18: Develop mobile applications with Flex

© 2010 Adobe Systems Incorporated. All Rights Reserved.

Components that have Mobile Skins

§ Button

§ CheckBox

§ DataGroup

§ Group/HGroup/VGroup/TileGroup

§ Image/BitmapImage

§ Label List

§ RadioButton/RadioButtonGroup

§ Scroller

§ TextArea

§ TextInput

18

Page 19: Develop mobile applications with Flex

© 2010 Adobe Systems Incorporated. All Rights Reserved.

Mobile APIs

19

Page 20: Develop mobile applications with Flex

© 2010 Adobe Systems Incorporated. All Rights Reserved.

GEO APIs

§ Android Permission Required:

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

§ Geolocation.isSupported

§ g.addEventListener(GeolocationEvent.UPDATE, callbackFunction);

§ GeolocationEvent:

§ altitude

§ heading

§ horizontalAccuracy

§ latitude

§ longitude

§ speed

§ timestamp

§ verticalAccuracy

Page 21: Develop mobile applications with Flex

© 2010 Adobe Systems Incorporated. All Rights Reserved.

Accelerometer APIs

§ Accelerometer.isSupported

§ a.addEventListener(AccelerometerEvent.UPDATE, callbackFunction);

§ AccelerometerEvent:

§ accelerationX

§ accelerationY

§ accelerationZ

§ timestamp

Page 22: Develop mobile applications with Flex

© 2010 Adobe Systems Incorporated. All Rights Reserved.

Multi-Touch APIs

§ Android manifest change:

<uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>

§ Gesture OR Multitouch --- Multitouch.inputMode

§ MultitouchInputMode.GESTURE

§ TransformGestureEvent

§ GESTURE_PAN

§ GESTURE_ROTATE

§ GESTURE_SWIPE

§ GESTURE_ZOOM

§ GestureEvent.GESTURE_TWO_FINGER_TAP

§ PressAndTapGestureEvent.GESTURE_PRESS_AND_TAP

§ MultitouchInputMode.TOUCH_POINT

§ TouchEvent

§ TOUCH_BEGIN

§ TOUCH_END

§ TOUCH_MOVE

§ TOUCH_OUT

§ TOUCH_OVER

§ TOUCH_ROLL_OUT

§ TOUCH_ROLL_OVER

§ TOUCH_TAP

Page 23: Develop mobile applications with Flex

© 2010 Adobe Systems Incorporated. All Rights Reserved.

Remote Data

§ Android Permission Required:

<uses-permission android:name="android.permission.INTERNET"/>

§ Standard Flex Networking Libraries:

§ HTTPService

§ WebService

§ RemoteObject

Page 24: Develop mobile applications with Flex

© 2010 Adobe Systems Incorporated. All Rights Reserved.

Full Screen & Orientation

§ stage.displayState = StageDisplayState.NORMAL

§ stage.displayState = StageDisplayState.FULL_SCREEN

§ stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE

§ StageOrientationEvent:

stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, callbackFunction);

§ foo-app.xml:

<initialWindow>

<autoOrients>true</autoOrients>

Page 25: Develop mobile applications with Flex

© 2010 Adobe Systems Incorporated. All Rights Reserved.

Camera Access

§ Camera - Raw camera feed

<uses-permission android:name="android.permission.CAMERA" />

<uses-feature android:name="android.hardware.camera" android:required="true"/>

<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>

<uses-feature android:name="android.hardware.camera.flash" android:required="false"/>

§ CameraUI - Native Camera App

var cameraUI:CameraUI = new CameraUI();

cameraUI.launch(MediaType.IMAGE);

§ CameraRoll - Choose photos from the device's camera roll

var cameraRoll:CameraRoll = new CameraRoll();

cameraRoll.browseForImage();

cameraRoll.addBitmapData(bd);

25

Page 26: Develop mobile applications with Flex

© 2010 Adobe Systems Incorporated. All Rights Reserved.

Native App Integration

§ Open Email, Browser, Maps, Phone, or SMS

§ navigateToURL(new URLRequest('mailto:[email protected]'));

§ navigateToURL(new URLRequest('http://www.jamesward.com'));

§ navigateToURL(new URLRequest('http://maps.google.com/'));

§ navigateToURL(new URLRequest('tel:1234567890'));

§ navigateToURL(new URLRequest('sms:1234567890'));

26

Page 27: Develop mobile applications with Flex

© 2010 Adobe Systems Incorporated. All Rights Reserved.

Local DB APIs

§ SQLite - Nothing different than AIR for the Desktop

§ SQLConnection

§ Sync and/or Async connections

§ SQLStatement

§ Prepared Statements:

var stmt:SQLStatement = new SQLStatement();

stmt.sqlConnection = FlexGlobals.topLevelApplication['sqlConnection'];

stmt.text = "INSERT into giberish values(:giberish)";

stmt.parameters[":giberish"] = g.text;

stmt.execute();

Page 28: Develop mobile applications with Flex

© 2010 Adobe Systems Incorporated. All Rights Reserved.

StageWebView

§ Requires Android INTERNET permission:

<uses-permission android:name="android.permission.INTERNET" />

§ WebStageView.isSupported

var swv:StageWebView = new StageWebView();

swv.viewPort = new Rectangle(0, stage.height - height, width, height);

swv.stage = stage;

swv.loadURL("http://www.riagora.com");

28

Page 29: Develop mobile applications with Flex

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

Mobile applications + JAVA = REAL-TIME

29

Page 30: Develop mobile applications with Flex

LiveCycle Collaboration Service

IN-CONTEXT COLLABORATION

Webcam Chat

SharedForm

Page 31: Develop mobile applications with Flex

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

All external content and images pending approvals.

Multi-user collaboration in real time

LiveCycle Collaboration Service

Major Capabilities

Peer-to-peer (P2P) streaming of data, audio and video HTTP server-to-server APIsPrivate audio/video streaming Server-side provisioning of services

Large Rooms – via on-demand loading of user presence

Audio/video application multicast

Record and Playback Screen sharing

JavaScript APIs – integration with a customer’s exist ting websites

31

§ Engage more effectively through a web presence enhanced with real-time collaboration tools.

§ Integrate text chat, whiteboard functionality, webcam video, and audio into any rich Internet application (RIA),

Page 32: Develop mobile applications with Flex

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

LiveCycle Data Services today

32

Flex Client Flex Client Flex Client

LCDS

Java Classes

Thing1.classThing2.classThing3.class

Page 33: Develop mobile applications with Flex

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

LiveCycle Data Services tomorrow (2011)

33

LCDS

NET

??.?????.?????.???

Java Classes

Thing1.classThing2.classThing3.class

.NET C# Classes

Thing1.dllThing2.dllThing3.dll

IIS Plugin.NET RemotingMessagingMSMQ Messaging

.NET AdapterRemotingMessagingData Mgmt

.NET

Ada

pter

Flex Client Flex Client Flex ClientJava Client Android ClientHTML5/JS Client ObjC Client

Page 34: Develop mobile applications with Flex

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

Publish/Subscribe Messaging

Message

Service

LiveCycle DS / Blaze DS

Endpoint

PublisherSubscriber

§RTMP

§AMF

§HTTP

§Client A

§Client B

§Client C

Page 35: Develop mobile applications with Flex

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

Data Push - Messaging

Message

Services

LiveCycle DS / Blaze DS

Adapter Y

Adapter X

Messaging

System Y

Messaging

System X

EndpointJMS

ProviderJMS Adapter

PublisherSubscriber

§RTMP

§AMF

§HTTP

Page 36: Develop mobile applications with Flex

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

Data Push - Messaging

public static class GPSThread extends Thread { public boolean running = true;

public void run() { MessageBroker msgBroker = MessageBroker.getMessageBroker(null); String clientID = UUIDUtils.createUUID();

while (running) { double change = gpsService.getCurrentPosition();

AsyncMessage msg = new AsyncMessage(); msg.setDestination("feed"); msg.setClientId(clientID); msg.setMessageId(UUIDUtils.createUUID()); msg.setTimestamp(System.currentTimeMillis()); msg.setBody(new Double(change)); msgBroker.routeMessageToService(msg, null);

try { Thread.sleep(300); } catch (InterruptedException e) { }

Page 37: Develop mobile applications with Flex

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

Michaël Chaize & resources

37

@mchaize

RIAgora.com Flex.org

labs.adobe.com

developer.adobe.com

Tour de Mobile Flex

Page 38: Develop mobile applications with Flex

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

Page 39: Develop mobile applications with Flex

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

Bar Chart

0

1.3

2.5

3.8

5.0

Category 1 Category 2 Category 3 Category 4

Series 1Series 2Series 3

Try to use neutral colors for most chart elements, and highlight elements of interest with bright colors

39

Page 40: Develop mobile applications with Flex

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

Pie Chart

Sales

1st Qtr2nd Qtr3rd Qtr4th Qtr

Try to use neutral colors for most chart elements, and highlight elements of interest with bright colors

40

Page 41: Develop mobile applications with Flex

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

Gray Content Area Layout

For use with full-screen images or diagrams that look good on gray

41

Page 42: Develop mobile applications with Flex

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

Black Content Area Layout

For use with full-screen images or diagrams that look good on black

42

Page 43: Develop mobile applications with Flex

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

Color Palette

Dynamic

R - 136G - 120B - 104

R - 131G - 72B - 181

R – 251G - 176B - 52

R - 172G - 179B - 185

R - 0G - 164B - 228

R - 192G - 181B - 169

R - 255G - 221B - 0

R - 107G - 115B - 123

R - 255G - 0B - 0

R - 218G - 221B – 224

R - 193G - 216B - 47

R - 228G - 223B - 217

Neutral

Note

The Adobe corporate color palette has been incorporated into this presentation template.

Refer to the Corporate Brand Guidelines, found on Brand Center for more guidance on using this color palette

www.adobe.com/brandecenter