flex mobile for jug

60
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Condential. Michaël Chaize | Flash Platform Evangelist | www.RIAgora.com | @mchaize Flex and mobile apps

Upload: michael-chaize

Post on 16-May-2015

793 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Flex mobile for JUG

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Michaël Chaize | Flash Platform Evangelist | www.RIAgora.com | @mchaizeFlex and mobile apps

Page 2: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Adobe Flex for Java developers

2

Page 3: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Adobe Flex for Java developers

2

+

Page 4: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Adobe Flex for Java developers

3

+

Free and Open source Application framework

Easily build mobile, tablet, desktop and web applications

One single programming language, tool & codebase

Page 5: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Adobe Flex programming language

4

<MXML> AS3

<s:Scroller width="100%" height="100%" horizontalScrollPolicy="off"> <s:Group width="{this.width}"> <s:Image id="myImage"> <s:source> <s:MultiDPIBitmapSource source160dpi="assets/icons/splashLittle.jpg" source240dpi="assets/icons/splashMedium.jpg" source320dpi="assets/icons/splashBig.jpg"/> </s:source> </s:Image> <s:Button x="82" y="356" width="159" height="30" label="Jetzt anmelden" chromeColor="0xffa600" click="button1_clickHandler(event)" fontSize="14" textShadowColor="0x555555"/> </s:Group> </s:Scroller>

Page 6: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Adobe Flex programming language

5

<MXML> AS3

package contacts.application{ import contacts.domain.ContactManager;

public class AddContactsCommand { [Inject] public var service:IContactService; [Inject] public var manager:ContactManager; public function execute(event:AddContactsMessage):AsyncToken { return service.addContact(event.contact); } public function result(event:ResultEvent, trigger:AddContactsMessage):void { manager.addContact(trigger.contact); } public function error(event:FaultEvent, trigger:AddContactsMessage):void { trace("Error ! "); } }}

Page 7: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Adobe Flex programming language

6

<MXML> AS3

MVC

Page 8: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Adobe Flex programming language

7

Automated builds, debug & pro!le, CI, TDD, load/stressing...

Page 9: Flex mobile for JUG

©2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Flex & Java are already succesful on the desktop

&

Good UI = Efficient users = Success & ROI

Page 10: Flex mobile for JUG

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Page 11: Flex mobile for JUG

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

"e explosion of devices introduces new challenges for application development

Page 12: Flex mobile for JUG

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Native Mobile Application Development Model

NativeApp

NativeApp

NativeApp

NativeApp

Additional OS’s

A costly, inefficient development model

Page 13: Flex mobile for JUG

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Introducing a new mobile development paradigm

Additional OS’s

Flex Application

One Tool, One Language, One Codebase

Any Platform

Common codebase

Page 14: Flex mobile for JUG

SPARK COMPONENT MODEL

FLEX FRAMEWORK 4

ActionScript MXML

GraphicsLayout

AnimationParts

States

Component Skin

CSS properties

BehaviorLogicData

Page 15: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved.

Mobile Applications in Flex 4.5

13

s:Application

Page 16: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved.

Mobile Applications in Flex 4.5

13

s:ViewNavigatorApplications:Application

Page 17: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved.

Mobile Applications in Flex 4.5

13

s:TabbedViewNavigatorApplications:ViewNavigatorApplications:Application

Page 18: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved.

<s:ViewNavigatorApplication> life cycle

14

views.ListEmployees views.DetailsEmployee views.ListEmployees

DATA DATA

persisted in memory

subset

view destroyed view created

view destroyed view created

“BACK” bu!on

Page 19: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved.

<s:ViewNavigatorApplication> life cycle

14

views.ListEmployees views.DetailsEmployee views.ListEmployees

DATA DATA

persisted in memory

subset

view destroyed view created

view destroyed view created

“BACK” bu!on

Page 20: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved.

<s:ViewNavigatorApplication> life cycle

14

views.ListEmployees views.DetailsEmployee views.ListEmployees

DATA DATA

persisted in memory

subset

view destroyed view created

view destroyed view created

“BACK” bu!on

Page 21: Flex mobile for JUG

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

15 3

navigationContent titleContent actionContent

Page 22: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved.

Components that have Mobile Skins

§ Bu$on

§ CheckBox

§ DataGroup

§ Group/HGroup/VGroup/TileGroup

§ Image/BitmapImage

§ Label List

§ RadioBu$on/RadioBu$onGroup

§ Scroller

§ TextArea

§ TextInput

16

Page 23: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Multiple densities: "e problem

17

150 x 40 pixel bu$on

Page 24: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Multiple densities: "e problem

17

150 x 40 pixel bu$on

Desktop monitor@100 dpi

= 1.5” x 0.4”

Page 25: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Multiple densities: "e problem

17

150 x 40 pixel bu$on

Desktop monitor@100 dpi

= 1.5” x 0.4”

Galaxy Tab@160 dpi

= 0.9” x 0.25”

Page 26: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Multiple densities: "e problem

17

150 x 40 pixel bu$on

Desktop monitor@100 dpi

= 1.5” x 0.4”

Galaxy Tab@160 dpi

= 0.9” x 0.25”

Droid 2@240 dpi

= 0.6” x 0.17”

Page 27: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Multiple densities: "e problem

17

150 x 40 pixel bu$on

Desktop monitor@100 dpi

= 1.5” x 0.4”

Galaxy Tab@160 dpi

= 0.9” x 0.25”

Droid 2@240 dpi

= 0.6” x 0.17”

iPhone 4@320 dpi

= 0.46” x 0.13”

Page 28: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Multiple densities: "e problem

17

150 x 40 pixel bu$on

Desktop monitor@100 dpi

= 1.5” x 0.4”

Galaxy Tab@160 dpi

= 0.9” x 0.25”

Droid 2@240 dpi

= 0.6” x 0.17”

iPhone 4@320 dpi

= 0.46” x 0.13”

Same pixel count, different physical sizes(Minimum recommended size: 0.25” x 0.25”)

Page 29: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Multiple densities: "e problem

17

150 x 40 pixel bu$on

Desktop monitor@100 dpi

= 1.5” x 0.4”

Galaxy Tab@160 dpi

= 0.9” x 0.25”

Droid 2@240 dpi

= 0.6” x 0.17”

iPhone 4@320 dpi

= 0.46” x 0.13”

Same pixel count, different physical sizes(Minimum recommended size: 0.25” x 0.25”)

Page 30: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Can I use dynamic layout to solve this?

18

Page 31: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Can I use dynamic layout to solve this?

18

(Not easily. You can make stuff "ll the screen using percent sizing, but your fonts and icons will still be tiny. And any "xed pixel sizes, e.g. in constraint-based layouts or padding values, will be wrong.)

320x480 @160dpi

Page 32: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Can I use dynamic layout to solve this?

18

(Not easily. You can make stuff "ll the screen using percent sizing, but your fonts and icons will still be tiny. And any "xed pixel sizes, e.g. in constraint-based layouts or padding values, will be wrong.)

320x480 @160dpi

100%

100%

Page 33: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Can I use dynamic layout to solve this?

18

(Not easily. You can make stuff "ll the screen using percent sizing, but your fonts and icons will still be tiny. And any "xed pixel sizes, e.g. in constraint-based layouts or padding values, will be wrong.)

(Not easily. You can make stuff "ll the screen using percent sizing, but your fonts and icons will still be tiny. And any "xed pixel sizes, e.g. in constraint-based layouts or padding values, will be wrong.)

320x480 @160dpi 640x960 (at same density)

100%

100%

Page 34: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Can I use dynamic layout to solve this?

18

(Not easily. You can make stuff "ll the screen using percent sizing, but your fonts and icons will still be tiny. And any "xed pixel sizes, e.g. in constraint-based layouts or padding values, will be wrong.)

(Not easily. You can make stuff "ll the screen using percent sizing, but your fonts and icons will still be tiny. And any "xed pixel sizes, e.g. in constraint-based layouts or padding values, will be wrong.)

320x480 @160dpi 640x960 (at same density)

100%

100%

100%

100%

Page 35: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Can I use dynamic layout to solve this?

18

(Not easily. You can make stuff "ll the screen using percent sizing, but your fonts and icons will still be tiny. And any "xed pixel sizes, e.g. in constraint-based layouts or padding values, will be wrong.)

(Not easily. You can make stuff "ll the screen using percent sizing, but your fonts and icons will still be tiny. And any "xed pixel sizes, e.g. in constraint-based layouts or padding values, will be wrong.)

320x480 @160dpi 640x960 (at same density) 640x960 @320dpi

100%

100%

100%

100%

Page 36: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Solution: Automatic scaling for different DPIs

19

Page 37: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Solution: Automatic scaling for different DPIs

19

<Application applicationDPI=“160”> <Button width=“160” height=“40”/></Application>

Page 38: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Solution: Automatic scaling for different DPIs

19

<Application applicationDPI=“160”> <Button width=“160” height=“40”/></Application>

160 dpi 240 dpi 320dpi

Page 39: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Solution: Automatic scaling for different DPIs

19

<Application applicationDPI=“160”> <Button width=“160” height=“40”/></Application>

160 dpi 240 dpi 320dpi

Scaled 1.5x

Page 40: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Solution: Automatic scaling for different DPIs

19

<Application applicationDPI=“160”> <Button width=“160” height=“40”/></Application>

160 dpi 240 dpi 320dpi

Scaled 1.5x Scaled 2x

Page 41: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Solution: Automatic scaling for different DPIs

19

<Application applicationDPI=“160”> <Button width=“160” height=“40”/></Application>

REMEMBER: To your code, the screen is always 160 dpi, and this bu$on is always160 x 40, regardless of how the application is being scaled.

160 dpi 240 dpi 320dpi

Scaled 1.5x Scaled 2x

Page 42: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved.

Screens and Flex 4.5

<?xml version="1.0" encoding="utf-8"?>

<s:MobileApplication applicationDPI="160"> ...

20

var curDensity:Number = FlexGlobals.topLevelApplication.runtimeDPI;

<s:Image> <s:source> <s:MultiDPIBitmapSource source160dpi="logo.png" source240dpi="logo240.png" source320dpi="logo320.png" /> </s:source> </s:Image>

Page 43: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Flex 4.5 and tablets

21

Page 44: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Flex 4.5 and tablets

21

Android tablets

Page 45: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Flex 4.5 and tablets

21

BlackBerry PlayBookAndroid tablets

Page 46: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Flex 4.5 and tablets

21

BlackBerry PlayBookAndroid tablets Apple tablets

Page 47: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Flex 4.5 and tablets

21

BlackBerry PlayBookAndroid tablets Apple tablets

Page 48: Flex mobile for JUG

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Demo

22

Page 49: Flex mobile for JUG

©2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

New APIs for mobile apps

- Multitouch- Geolocation- Cameras- Microphone- Accelerometer- Display a web page- SQLite local database- Native extensions- GPU acceleration

Page 50: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Create your on libraries

24

Page 51: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Create your on libraries

24

ANE: No more limitation

ActionScript Native Extension

Page 52: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Create your on libraries

24

ANE: No more limitation

ActionScript Native Extension

Page 53: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Create your on libraries

24

ANE: No more limitation

ActionScript Native Extension

C, JAVA

Page 54: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Create your on libraries

24

ANE: No more limitation

ActionScript Native Extension

AS3 bridge

C, JAVA

Page 55: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Create your on libraries

24

ANE: No more limitation

ActionScript Native Extension

AS3 bridge

C, JAVA

ANE

Page 56: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Create your on libraries

24

ANE: No more limitation

ActionScript Native Extension

AS3 bridge

C, JAVA

Flex Mobileproject

ANE SWF

.AIR, .APK, .IPA, .BAR

Page 57: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Tomorrow’s Enterprise applications

25

Page 58: Flex mobile for JUG

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Tomorrow’s Enterprise applications

25

Business opportunities

Flex + JAVA services

Page 59: Flex mobile for JUG

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.

Michaël Chaize & resources

26

@mchaize

RIAgora.com Flex.orglabs.adobe.com

developer.adobe.com

Tour de Mobile Flex

Page 60: Flex mobile for JUG

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Con!dential.