Session Presented at 1st IndicThreads.com Conference On Mobile Application Development held on 19-20 November 2010 in Pune, India WEB: http://M10.IndicThreads.com ------------ Speaker: Hemanth Sharma Abstract: Write one code, ActionScript, and publish your application to multiple mobile devices, web, and desktops. Learn the aspects of multiscreen coding using Adobe Flex, Flash Builder, Flash Professional and emulate your content in Adobe Device Central. This session will cover ActionScript coding & designing for multi-screen and deployment across multiple devices making use of device specific features such as accelerometer, multitouch gestures, geolocation, etc..
Citation preview
1. Hemanth Sharma Adobe Flash Platform Platform Evangelist for
Mobile Adobe Systems Development 1
2. Adobe Flash Platform 2
3. Why Flash Platform? Adobe Flash Platform Tooling is
Supported on Windows & Macintosh Flash Player Runtime is
Supported on Win/Mac/Linux, etc Flash Lite 1.0 - Flash Lite 4.0
Flash Player 10.1 Adobe Integrated Runtime (AIR) Microphone Access
Native Processes Hardware Acceleration 3
6. Multiscreen User Interface / Layout FIXED LAYOUT FLUID /
FLEXIBLE LAYOUT Less File Size Common / Re-usable UI Elements Less
Compromises Common Code Can still manage Common Code Easy Bug Fixes
Easy to manage Screen-speci c Multiple Projects Generally 1 Project
Layout-speci c UI Elements Heavy File Size Dicult Bug Fixes
Non-shareable Project File 6
7. Fixed Layout DESKTOP / TABLET DEVICE 7
8. Flexible Layout LANDSCAPE PORTRAIT 8
9. Weigh your Requirements WEIGH 9
10. Flexible Layout FLASH PROFESSIONAL + FLASH PROJECT - Custom
Flexible Layout Class stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT; function
setPosition(e:Event):void { if (stage.stageWidth <
stage.stageHeight) { // Adjust UI Elements for Vertical Layout }
else { // Adjust UI Elements for Horizontal Layout } }
setPosition(null); stage.addEventListener(Event.RESIZE,
setPosition) 10
15. Hardware Keys
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown, false, 0,
true); function onKeyDown(event:KeyboardEvent):void { //Back Key if
(event.keyCode == 94) { event.preventDefault(); // to kill event
from running default behavior //do your own back stuff } //Menu Key
if (event.keyCode == 95) { event.preventDefault(); // to kill event
from running default behavior //do your own back stuff } } 15
16. Approach ird Party CORE Libraries Libraries Smart Layout
Desktop Web Mobile Tablet 16
17. Coding Approach FLEX PROJECTS 17
18. Flash Professional + Flash Builder h
p://www.tinyurl.com/multiscreen1 h p://www.tinyurl.com/multiscreen2
18
19. Testing & Simulation 19
20. AIR Packaging .air .exe .dmg FLASH PROFESSIONAL CS5 .apk
.ipa 20
21. Packaging for Android .apk 21
22. Whats new in Flash Builder (Burrito) & Adobe Flex? New
Flex SDK Hero Multiscreen Flex development Optimized Mobile Flex
components based on Spark More Spark components 22
23. New Flex Mobile Components 23
24. View Based Apps 24
25. Flex Mobile Work ow .apk 25
26. DEMO & DEVELOPMENT WALKTHROUGH 26
27. Content Optimization & Tips Bitmaps for Performance Vs
Vectors for Less Memory Keep bitmaps as small as possible Reduce
number of nodes for Vectors Use opaque background for texts
Experiment with Anti-aliasing options for text Use only if
absolutely necessary (for Mobile Content) Filters Blend Modes
Transparency Perspective Distortion 27
28. Content Optimization & Tips Set Frame Rate as low as
possible Adjust Frame Rate dynamically Combine Event Handlers
functions wherever possible Use EnterFrame over Timers Use
Event.RESIZE over StageOrientationEvent.ORIENTATION_CHANGE Place
text/graphics on whole pixels (Pixel Boundaries) Avoid object
creation inside loops Instantiate one Library Bitmap and re-use the
BitmapData Use Loader.unloadAndStop(); - Sounds, Listeners, Timers,
HW, etc. 28
29. Video Player Optimization Tips Minimize redraw region
during Video playback Reduce frquency of non-video updates
(Playhead, etc.) Avoid overlapping graphics / transparent overlays
Avoid rotation, skew and perspective projections Do not
CacheAsBitmap Avoid lters, ScrollRect, .z Avoid color transforms,
alpha Stop EnterFrame handlers and Timers Stop all timelines
29
30. Resources h p:// ex.org/tourmobile h
p://labs.adobe.com/technologies/ ex/mobile/ h
p://www.tinyurl.com/multiscreen1 h p://www.tinyurl.com/multiscreen2
h p://groups.adobe.com h p:// ashproindia.groups.adobe.com h
p://labs.adobe.com h p://tv.adobe.com 30
31. Questions? Web: h p://www.hsharma.com/tech Twi er:
@hemanthsharma Facebook h p://www.facebook.com/hemanthsharma
31