Introduction to Flex Hero for Mobile DevicesPresentation Transcript
Building Mobile Applications with Flex “Hero”
Ryan Stewart Developer Evangelist, Adobe ryan@adobe.com blog.digitalbackcountry.com @ryanstewart github.com/ryanstewartBased in SeattleThings I Like: Beer Mountaineering/Hiking/Backpacking Geolocation/Mapping stuff
People here smarter than I am
Agenda Flash on Mobile Devices Introduction to Flex Mobile UI Paradigms with Flex Mobile Optimizing for Flex MobileBonus! - Features of Flash Player 10.2
Mobile Flash Development
Flash Player 10.1In-browser content Games, video Deploy as a SWF, put on the web
Flash Player 10.1 Adobe AIRIn-browser content Mobile applications Games, video Native APIs, extra functionality Deploy as a SWF, put on the web Package to target individual devices
AIR for Devices.ipa .bar .apk
AIR for Device Applications are “Native”That means they can be put on app stores NOT that the UI components are native
So we can use Flex to build native apps
Issues with Flex on Mobile DevicesComplex Components: DataGrids, Charts, Tree Memory Footprint Desktop UI Screen Patterns
What does Mobile Optimized Mean? Rewrote and optimized UIComponentCreated a mobile theme which supports: Bigger components CSS Style for enabling touch (Scrollers)
The Mobile ThemeUsed automatically when MobileApplication tag is used Includes larger, touch-friendly controls Adds inputMode CSS style for touch
interactionMode Style mouse touchFires hover events Creates wider hit area Use scrollbar Hides scrollbar
interactionMode can in theory be used to swap between devices while keeping the same codebase.
Mobile UI Patterns in Flex “Hero”
ViewNavigator The pattern for screens on devices Can define transitions between views Uses push/pop stack to move between views
ViewNavigator The pattern for screens on devices Can define transitions between views Uses push/pop stack to move between views
TabNavigator Tab through views Just set up multiple ViewNavigators with the firstView property Can’t use push/pop
ActionBarnavigationContent actionContent titleContentProvides easy access to important features Won’t scroll Can be defined globally or for each view
Optimization Techniques
Use as Much ActionScript as Possible ItemRenders Skins* Custom Components*In general, a few MXML skins won’t hurt, especially if you use FXG assets
Graphical Assets In general, the fastest typewill be ActionScript and Bitmaps MXML is pretty slow: Don’t use MXML GraphicsDon’t use MXML skins with FXG Pre-compiled FXG with AS3 is a pretty good solution
Use a SplashScreen Flex takes a bit of time to loadsplashScreenImage is set to be fast and first Provides near-instant user feedback
View Events Perform data actions AFTER the Transition The View dispatches a CREATION_COMPLETEevent before the transition happens Listen for the VIEW_ACTIVATE event, then perform data operations
View B Added to Display ListView A View B Dispatches FlexEvent.ADD View B View B Dispatches FlexEvent.CREATION_COMPLETE View A Dispatches FlexEvent.VIEW_DEACTIVATE Do Transition View A Dispatches FlexEvent.REMOVE View B Dispatches FlexEvent.VIEW_ACTIVATE
New Stuff StageVideo NativeCursorFull Screen Mode for Multiple Monitors Hardware Acceleration for IE9
StageVideo
What’s Happening?StageVideo is being hardware accelerated Plus, normally Flash content all runs through the same rendering pipeline StageVideo puts the video on its own layer, so it can’t be transformed, but it performs very well
flash.display.MouseCursorData Lets you define bitmap sources as native cursors Vastly improved performance over current methods
Full Screen Mode for Multiple Monitors When something is full screen on one monitor, you can still work on the other without taking it out of fullscreen mode...... The Hulu feature :)
Hardware acceleration on IE9 We’ve been working with Microsoftto make the Flash/IE9 experience top notch Flash Player 10.2 uses IE9 APIs for hardware acceleration Should see great performance with IE9