android development with flash platform
DESCRIPTION
My slides from Google Technology User Group Rhein-Main EventTRANSCRIPT
© 2011 Adobe Systems Incorporated.
Android Mobile Development & !e Flash Platform Mihai Corlan | Developer Evangelist | h"p://corlan.org
© 2011 Adobe Systems Incorporated.
About Me
§ Adobe Worldwide Developer Evangelist (since 2008)
§ Flash Builder Engineer 2006-2008
§ Web Developer 2000 - 2006
§ Blog: h"p://corlan.org
§ Twi"er: h"p://twi"er.com/mcorlan
§ Email: [email protected]
2
© 2011 Adobe Systems Incorporated.
Agenda
§ Adobe Flash Platform and mobile devices
§ Examples of Android Apps created using AIR
§ Code and Work#ows – Flex and AIR
© 2011 Adobe Systems Incorporated.
What’s Multi-Screen Revolution Anyway?
Internet
© 2011 Adobe Systems Incorporated.
Multi-screen and Adobe AIR
Native App
Native App
Native App
Native App
Native App
Native App
© 2011 Adobe Systems Incorporated.
Adobe AIR
Flex / ActionScript
Multi-screen and Adobe AIR
© 2011 Adobe Systems Incorporated.
Android
© 2011 Adobe Systems Incorporated.
AIR apps for Android
§ RIA / Connected Apps / Video
§ Enterprise Apps
§ Remote Controls Apps for Desktop Apps
§ Games
More than 1,000 apps built using Adobe AIR are available on Android Market:
h"p://www.appbrain.com/apps/popular/adobe-air/
© 2011 Adobe Systems Incorporated.
Examples of AIR for Android Applications
© 2011 Adobe Systems Incorporated.
!e Flash Platform
Adobe® Flash® Player
Adobe® Flex ® Adobe® Flash® Media Server Family
Tools to Design and Develop Clients Servers Framework
Adobe® AIR® Adobe® Flash® CS5 Professional
Adobe® Flash® Catalyst™
Adobe® Flash® Builder™
Adobe® LiveCycle® Data Services
Applications, Content and Video
Services
Adobe® Flash® Platform Services
Integrating with the Flash Platform
Creative Suite 5 ColdFusion Builder
“Panini”
“Hero” 2.6
10.2
“Burrito”
Adobe® LiveCycle® Collaboration Service
© 2011 Adobe Systems Incorporated.
How do you build AIR Apps for Android?
Adobe AIR SDK Flex “Hero”
Flash Builder “Burrito”
LiveCycle Data
Services
LiveCycle Collaboration
Service
© 2011 Adobe Systems Incorporated.
!e Flex “Hero” 4.5 framework and ActionScript
§ An open source framework of ActionScript classes
§ Rich library of UI components
§ Other “utilities” that speed up app development (services, validators, data binding, layout managers, …)
§ MXML – a declarative language for quickly layout your app
Flex “Hero”
© 2011 Adobe Systems Incorporated.
Tools – Flash Builder “Burrito” 4.5
§ Eclipse based IDE for Flex and ActionScript development
§ Support for design view and local testing
§ Support for packaging the app as an APK $le
§ Deploy the app to connected Android devices
§ Debugging the app on the device or desktop simulator
Download from h"p://labs.adobe.com
Free for educational / 60-day trial period
Flash Builder
© 2011 Adobe Systems Incorporated.
AIR APIs on Android
§ Camera and Microphone access
§ Accelerometer
§ GPS
§ Multitouch/Gestures
§ Screen Orientation / Fullscreen
§ Phone/SMS/Email/Browser/Android Market
§ Camera (Including Camera Roll Support) & Mic
§ StageWebView
§ Session Cache Support – Restore App State
§ Hardware Bu"ons Support
§ Local database (SQLite)
§ …
Adobe AIR
© 2011 Adobe Systems Incorporated.
Live Coding – a simple AIR App for Android
© 2011 Adobe Systems Incorporated.
Se"ing Android Permissions
© 2011 Adobe Systems Incorporated.
Se"ing Android Permissions
Use Application Descriptor File -> AndroidManifest.xml $le
<android><manifestAdditions><![CDATA[
<manifest android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
</manifest>]]></manifestAdditions>
</android>
© 2011 Adobe Systems Incorporated.
Options for Building Mobile AIR Apps using Burrito
§ ActionScript Mobile Project (no MXML)
§ Flex Mobile Project:
§ Blank – s:Application
§ Mobile Project - s:MobileApplication
§ Mobile Project – s:TabbedMobileApplication
© 2011 Adobe Systems Incorporated.
MobileApplication vs. TabbedMobileApplication
© 2011 Adobe Systems Incorporated.
Flex Mobile Components
Screen Metaphor
Application First Screen Second Screen
© 2011 Adobe Systems Incorporated.
Flex Mobile Components - ViewNavigator
Using Flex’s s:MobileApplication or s:TabbedMobileApplication you get screen management for free
§ navigator.push(NewScreen, data) - add new screen
§ navigator.popView() - go to previous screen
§ navigator. popToFirstView() - go to $rst view
§ navigator.activeView - retrieve active view
© 2011 Adobe Systems Incorporated.
Architecture of Flex Mobile App
MobileApplication
ViewNavigator
ActionBar
View
Support for screen navigation; Application persistence between sessions
Application UI: - screens/lists/bu"ons/titles
© 2011 Adobe Systems Incorporated.
View Lifecycle
View Another View
Created Created Destroyed Destroyed Created
Data
?
Destroyed
data = yourData; destructionPolicy =”none"
© 2011 Adobe Systems Incorporated.
View and ActionBar Components
Hide the Action Bar: actionBarVisible = false; Overlay the Action Bar: overlayControls = true;
© 2011 Adobe Systems Incorporated.
Mobile Components
§ Bu"on
§ CheckBox
§ RadioBu"on
§ TextInput
§ TextArea
§ List
§ ScrollBar
Touch Enabled
Mobile Skins: ActionScript
based skins and FXG
Other components will come
© 2011 Adobe Systems Incorporated.
Lists and Item Renderers
MobileItemRenderer
<s:MobileItemRenderer label="Beer"/>
MobileIconItemRenderer
<s:MobileIconItemRenderer
labelField="label" messageField="message" iconField="icon" decoratorClass="phoneIcon"/>
© 2011 Adobe Systems Incorporated.
Splash Screen
<s:MobileApplication splashScreenImage="@Embed(source='assets/splash-screen.png')"
© 2011 Adobe Systems Incorporated.
Helper Apps for Mobile Development
AIR app for Desktop
Adobe AIR Launchpad Tour de Mobile Flex
Android AIR App
© 2011 Adobe Systems Incorporated.
What’s Next?
§ 3D APIs GPU Accelerated for Flash Player & AIR on desktop and mobiles (Direct3D 9 and OpenGL ES)
§ Native extensions for AIR for Android
§ Extending Flex “Hero” to iOS and BlackBerry Tablet OS
© 2011 Adobe Systems Incorporated.
Resources
§ MP3 Remote Control for Android: h"p://corlan.org/2010/07/02/creating-multi-screen-apps-for-android-and-desktop-using-air/
§ LiveCycle Collaboration Service showcase for Android tablets: h"p://www.riagora.com/2011/03/lccs-showcase-on-your-tablet/
§ Mobile development with Flash Builder Burrito and Hero: h"p://www.adobe.com/devnet/#ex/articles/mobile_development_hero_burrito.html
§ Ge"ing Flash Builder “Burrito”: h"p://labs.adobe.com
§ Tour de Mobile Flex: h"p://#ex.org/tourmobile
§ MAX 2010 Sessions Recordings (Channels > MAX 2010): h"p://tv.adobe.com
© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con$dential. © 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con$dential.
© 2011 Adobe Systems Incorporated.
Adobe, the Adobe logo, Adobe AIR, the Adobe AIR logo, the Adobe PDF logo, AIR, ColdFusion, ColdFusion Builder, Flash, Flash Builder, the Flash logo, Flex, LiveCycle, and Reader are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. All other trademarks are the property of their respective owners. © 2010 Adobe Systems Incorporated. All rights reserved. Printed in the USA. 9102xxxx 3/10
Adobe, the Adobe logo, Adobe AIR, the Adobe AIR logo, ActionScript, AIR, Flash, Flash Builder, Flash Catalyst, the Flash logo, Flex, and LiveCycle are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. Microso% and Windows are either registered trademarks or trademarks of Microso% Corporation in the United States and/or other countries. Java is a trademark or registered trademark of Sun Microsystems, Inc. in the United States and other countries. All other trademarks are the property of their respective owners. Printed in the USA. 91023957 3/10
© 2011 Adobe Systems Incorporated.
Agenda
Flash Platform
Mobile Apps