Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Adobe AIR 2.5 Beta for Android


Published on

In this presentation I walk through the new features of AIR for Android, currently in Beta.

Published in: Technology
  • Be the first to comment

Adobe AIR 2.5 Beta for Android

  1. 1. AIR 2.5 Beta (and Flash Player 10.1)<br />Mark Doherty, Platform Evangelist for Mobile and Devices - @markadoherty <br />
  2. 2. Flash Player 10.1 - Update<br />Delivered: June 2010<br />Available: at and the Android Market<br />The only consistent browser-based runtime for connected devices<br />Targeting desktops, mobile phones, netbooks, tablets, and the Digital Home<br />
  3. 3. Technology Partners<br />Open Screen Project<br />Content Partners<br />
  4. 4. Brings full Flash Player feature set to devices<br />New Features:<br />Multi-touch & gestures (not on Android)<br />Accelerometer<br />Screen orientation<br />Mobile text input<br />Device capabilities discovery<br />Globalization support (GSLib)<br />Mobile settings manager<br />Global error handling<br /><ul><li>Optimized SWF management for mobile
  5. 5. Sleep mode</li></ul>Flash Player 10.1<br />
  6. 6. Accelerometer<br />import flash.sensors.Accelerometer;<br />import;<br />if (Accelerometer.isSupported)<br />{<br />varaccel:Accelerometer = new Accelerometer();<br />accel.addEventListener(AccelerometerEvent.UPDATE,updateHandler);<br />}<br />functionupdateHandler(e:AccelerometerEvent):void<br />{<br />e.accelerationX;<br />e.accelerationY;<br />e.accelerationZ;<br />}<br />
  7. 7. Gestures<br />import;<br />cell.addEventListener(TransformGestureEvent.GESTURE_ZOOM, onZoom);<br />function onZoom(e:TransformGestureEvent):void<br />{<br />cell.scaleX *= e.scaleX;<br />cell.scaleY = cell.scaleX;<br />}<br />cell.addEventListener(TransformGestureEvent.GESTURE_ROTATE, onRotate);<br />function onRotate(e:TransformGestureEvent):void<br />{<br />cell.rotation += e.rotation;<br />}<br />
  8. 8. Code<br />
  9. 9. Browser Download<br />Complementary deployment mechanisms for mobile<br />Downloaded through on-device catalog<br />Bundled with System Software Updates<br />
  10. 10. Flash Player on most smartphones shipping in 2012, >250M cumulative<br />53%<br />35%<br />9%<br />Source: Strategy Analytics smartphone forecast (January 2010) and Adobe adoption estimates<br />
  11. 11. AIR 2.5 (beta)<br />
  12. 12. Adobe AIR for smartphones (and tablets)<br />Adobe AIR allows developers to build standalone applications using Flash technology<br />Android Beta is underway, Google and RIM support AIR<br />First mobile operating system to be supported is Android<br />Provides Flash developers access to app stores<br />
  13. 13. Includes Flash Player 10.1 feature set<br />Additional Features:<br />Multi-touch & gestures<br />Geolocation<br />cut/copy/paste<br />tel:, mailto:, maps:, video:<br />Camera<br />Microphone<br />StageWebView<br />Device Debugger<br />cacheAsBitmapMatrix<br />AIR 2.5 (Available in Beta)<br />
  14. 14. Creating an Android App: Setup<br />Get the Android SDK:<br /> Allows you to create and install apps on your device<br /><ul><li> Android - SDK Manager to install packages etc.
  15. 15. ADB – Android Device Debugger installs apps on your device
  16. 16. DDMS - Dalvik Debug Monitor for desktop simulation.</li></ul>Join the AIR Prerelease:<br /><ul><li> Get AIR for Android runtime .apk installed
  17. 17. Get the AIR for Android Extension for Flash CS5</li></li></ul><li>Flash CS5 AIR for Android Extension<br />Create, install and launch an .apk using Flash Professional CS5<br />.apk<br />
  18. 18. AIR Packaging & Distribution Workflow<br />.apk<br />.exe<br />.deb / .rpm<br />.air<br />.dmg<br />native code and distribution<br />
  19. 19. Geolocation<br />import flash.sensors.Geolocation;<br />vargeo:Geolocation;<br />if (Geolocation.isSupported) {            geo = new Geolocation();            geo.addEventListener(GeolocationEvent.UPDATE, updateHandler);            geo.setRequestedUpdateInterval(10000);}<br />function updateHandler(e:GeolocationEvent):void<br />{<br />e.accelerationX;<br />e.accelerationY;<br />e.accelerationZ;<br />}<br />
  20. 20. Challenges: Performance of the SDK, Different screen sizes and densities.<br />Solution: Hero - is the Flex 4 Framework<br /><ul><li>Optimizes both the performance and user experience
  21. 21. New mobile development capabilities:
  22. 22. Managing application “screens”
  23. 23. Resolution-independent layout
  24. 24. New user interface components designed for mobile form factors</li></ul>Flex on Mobile?<br />
  25. 25. Resources<br /><ul><li>Adobe TV
  26. 26. Optimization guides:
  27. 27. Flash Player optimization for mobile devices
  28. 28. AIR best practices for mobile devices
  29. 29. Ads optimization
  30. 30.
  31. 31.</li></li></ul><li>Optimization<br />
  32. 32. Graphics<br /><ul><li> Consider bitmaps over vectors
  33. 33. Keep bitmaps as small as possible
  34. 34. Minimize number of vectors
  35. 35. Test your animations with different qualities of Stage</li></ul>Avoid, if possible:<br /><ul><li> Filters
  36. 36. Blend modes
  37. 37. Transparency
  38. 38. Perspective distortion</li></li></ul><li>Reuse objects!<br />
  39. 39. Text<br /><ul><li>Use opaque background over transparency
  40. 40. Avoid TLF
  41. 41. Test different anti-aliasing technics (animation, bitmap text...)
  42. 42. Avoid frequently-updated text</li></ul>LoremIpsum dolor…<br />
  43. 43. Redraw Regions<br /><ul><li> If an object's properties are changed, its bounding box is a "redraw region"
  44. 44. Objects that overlap the redraw region are redrawn</li></ul>See which areas of your movie are refreshed every frame.<br /><ul><li> Test Movie. View > Show Redraw Regions
  45. 45. Right-click > Show Redraw Regions (debug player only)</li></li></ul><li>Horizontal? Vertical? Both? <br /><ul><li>Content should dictate orientation, but don’t forget about the keyboard.
  46. 46. Consider adjusting content based on layout:</li></ul>stage.scaleMode = StageScaleMode.NO_SCALE;<br />stage.align = StageAlign.TOP_LEFT;<br />function setPosition():void<br />{<br />vidHolder.x = stageWidth/2 - vidHolder.width/2;<br />vidHolder.y = stageHeight/2 - vidHolder.height/2;<br /> //If the layout is vertical<br /> if (stage.stageWidth < stage.stageHeight)<br /> {<br /> //Adjust graphics<br /> }<br />}<br />setPosition();<br />stage.addEventListener(Event.RESIZE, resizeLayout);<br />function resizeLayout(e:Event):void<br />{<br />setPosition();<br />}<br />800px<br />800px<br />480px<br />480px<br />
  47. 47. Display Objects<br /><ul><li> Use the appropriate type of display object
  48. 48. getSize(); will return object size</li></ul>Objects that aren’t interactive, use Shape();<br />trace(getSize(new Shape()));<br />// output: 216<br />Interactive but no timeline? Use Sprite();<br />trace(getSize(newSprite()));// output: 396<br />Need animation? Use Movieclip();<br />trace(getSize(newMovieClip()));// output: 416<br />
  49. 49. Bitmap Caching<br />cacheAsBitmap - the object is rendered into an offscreen bitmap<br />Automatically used when:<br /><ul><li> Object overlaps a redraw region and the object is unchanged (except position)</li></ul>Bitmap caching issues:<br /><ul><li> Uses a lot of memory (width * height * 4 bytes)
  50. 50. Objects with cached bitmaps are more expensive to change</li></ul>Don’t use cacheAsBitmap when:<br /><ul><li> Animating object’s size
  51. 51. Animating position of object’s child</li></li></ul><li>Video performance problems<br />Inappropriate video encoding<br />Inefficient video player<br />
  52. 52. Video encoding format<br />
  53. 53.
  54. 54. The Flash Platform and HTML5<br />“HTML 5 and RIA platforms will be complementary technologies, and enterprise development shops will need to invest in both approaches to deliver expressive applications that combine reach and richness.”*<br />-Forrester<br />Adobe does and will continue to support HTML<br />The Flash Platform has integrated seamlessly with HTML for 14 years, and that won’t change<br />AIR 2.0 (desktop) includes support for HTML5<br />Adobe is committed to supporting HTML5 in its leading Web development tools<br />The Flash Platform delivers cross-platform, cross-browser, cross-device consistency<br />HTML5 implementations will differ and hinder content adoption of rich features, including video tag support<br />No consistency in codec support for video is yet visible<br />Adobe offers best-in-class tool chain used by 3.5 million designers and developers<br />HTML5 will require and benefit from Adobe’s investment in breadth of tooling<br />Rapid update cycles enable Flash innovations to reach ubiquity in less than 1 year<br />Flash will continue to lead in innovation, much faster than HTML and browsers<br />*“Does HTML 5 Herald The End Of RIA Plug-Ins? Not Really,” Forrester Research, Inc., April, 2010<br />All external content and images pending approvals.<br />