Suzanne AlexandraMotorolaYour First Flash Application for AndroidFor Android Developers
@suzalexdeveloper.motorola.com#AnDevConPresentation Title     Version 1.0      02.24.09
Where's the droid?Hint: Café au laitPresentation Title     Version 1.0      02.24.09
Part 1Why?
AIR on mobile devicesAdobe AIR for Mobile Deviceshttp://moto.ly/airmobile
    Visually stunning · easy to build · Android Market · multiple platforms
    The Flash universeRuntimesAdobe® AIR®Adobe® Flash® PlayerThe Flash universeApplications, content, and videoToolsFrameworkServices/ServersAdobe Flash Platform ServicesAdobe® Flash® CS5 ProfessionalAdobe® Flex®Adobe Flash Media Server familyAdobe® LiveCycle® Data ServicesAdobe® Flash® Builder™
FlashFlexUIs with componentsData-driven appsServer-based appsEnterprise appsXML + ActionScriptRich graphicsAnimations with timeline Video-based appsGamesPresentation Title     Version 1.0      02.24.09
Access device featuresMultitouch and gestureAccelerometerScreen orientationMobile text inputDevice capabilities discoveryCamera – image and videoCamera app and camera rollMicrophoneGeolocationNetwork connectivityPresentation Title     Version 1.0      02.24.09
When you need Android SDKServicesBackground threadsHome screen widgetsContent providersFront-facing cameraIntentsAccessing core appsBroadcast receiversNotificationsStatus barPresentation Title     Version 1.0      02.24.09
Page 7Where's the droid?Hint: Rhymes with peachPresentation Title     Version 1.0      02.24.09
AIR on which devices?Presentation Title     Version 1.0      02.24.09
When AIR is not on the devicePresentation Title     Version 1.0      02.24.09
Part 2How?
Adobe Flash Builder BurritoAdobe Flash Professional CS5Flash Extension for AIRDesign and development toolmoto.ly/getflashcs5moto.ly/getextDevelopment toolmoto.ly/burritoPresentation Title     Version 1.0      02.24.09
AIR on the deviceDownload from Android MarketOr install Runtime.apkPresentation Title     Version 1.0      02.24.09
The ActionScript class referencehttp://moto.ly/getasref
ActionScript and Java both …Are object-orientedHave packages, classes, and interfacesUse single inheritanceHave a base Object classAre strongly typedPresentation Title     Version 1.0      02.24.09
Comparing the syntax of Java and ActionScript 3http://moto.ly/asjavaBut ActionScript has …Dynamic classesGet / set functionsNo method overloadingNo threadsPresentation Title     Version 1.0      02.24.09
The stageFirst, a few key conceptsPresentation Title     Version 1.0      02.24.09
Declaring variablesJavapublic int number;public Object foo =        new Object();ActionScriptpublic var number:int;public var foo:Object        = new Object();Presentation Title     Version 1.0      02.24.09
Declaring methodsJavapublic int add( int first,    int second ) {   int sum = first + second;   return sum; }ActionScriptpublic function add(    one:Number, two:Number):Number{   var f:Number = one;   var s:Number = two;   var sum:Number = f + s;   return sum;}Presentation Title     Version 1.0      02.24.09
DemoBuilding a first appHint: Oolong teaPresentation Title     Version 1.0      02.24.09
AndroidManifest settings in app.xml<android>   <manifestAdditions>     <![CDATA[           <manifest> … your tags here …          </manifest>     ]]>   </manifestAdditions> </android>JavaPresentation Title     Version 1.0      02.24.09
Add permissions, for example<android>   <manifestAdditions>     <![CDATA[       <manifest> 	<uses-permission		 android:name="android.permission.INTERNET"/>      </manifest>     ]]>   </manifestAdditions> </android>JavaPresentation Title     Version 1.0      02.24.09
DemoDebugging on the deviceHint: Tequilas, tacosPresentation Title     Version 1.0      02.24.09
Part 3What about … ?
The activity lifecycleIt's managed for you!Nothing to doPresentation Title     Version 1.0      02.24.09
The Back keyBack exits the app by defaultYou can access Back and define actionsPresentation Title     Version 1.0      02.24.09
Using the Back keyprivate function onKeyDown(event:KeyboardEvent):void {     if ( event.keyCode == Keyboard.BACK ) {       event.preventDefault();       // do something     }}JavaPresentation Title     Version 1.0      02.24.09
Detecting screen resolutiontrace("screenResolutionX: " + Capabilities.screenResolutionX);trace("screenResolutionY: " + Capabilities.screenResolutionY);JavaOn XOOMscreenResolutionX: 1280screenResolutionY: 800Presentation Title     Version 1.0      02.24.09
Detecting supported gesturesimport flash.ui.MultiTouch;if (Multitouch.supportsGestureEvents == true) {  trace("Supported gestures" + Multitouch.supportedGestures );}JavaOn XOOMgestureZoom, gesturePan, gestureRotate, gestureTwoFingerTap, gestureSwipePresentation Title     Version 1.0      02.24.09
MultitouchMichael Chaizewww.RIAgora.comGreat resourcesGamesHemant SharmaCrazy Gemswww.hsharma.com/techGamesPaul TraniDoodle Galaxy Invaderspaultrani.comPresentation Title     Version 1.0      02.24.09
Okay, now …Where was the droid?
Questions?@suzalex@motodevwww.adobe.com/devnet/air.htmlmoto.ly/airmobileforummoto.ly/joinmotodev
MOTOROLA MOBILITY DEVELOPER NETWORKDetailed product specsPractical advice, technical articles, and documentationExpert support via forumsCommunity interaction via blogs, podcasts, and social mediaGlobal news, events, and training Web: developer.motorola.comTwitter: @motodev
GET STARTED NOW!Test Your Apps on the MOTODEV App Validatorhttp://moto.ly/appvalidatorJoin the MOTODEV CommunityAsk questions, read our blogs, and networkhttp://moto.ly/joinmotodevJoin our live chat with technical experts at the MOTODEV Office Hours March 16 2pm PSTDetails at http://moto.ly/officehoursTwitter: @motodev#andevcon
thank you
BSD LICENSEExcept when otherwise noted, sample source code is provided under the following terms.	Copyright (c) 2011, Motorola Mobility, Inc. All  rights reserved.	Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:	Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.	Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.	Neither the name of the Motorola, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.	THIS  SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH  DAMAGE.
APACHE 2 LICENSELicensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.	Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Your First Adobe Flash Application for Android

  • 1.
    Suzanne AlexandraMotorolaYour FirstFlash Application for AndroidFor Android Developers
  • 2.
  • 3.
    Where's the droid?Hint:Café au laitPresentation Title Version 1.0 02.24.09
  • 4.
  • 5.
    AIR on mobiledevicesAdobe AIR for Mobile Deviceshttp://moto.ly/airmobile
  • 6.
    Visually stunning · easy to build · Android Market · multiple platforms
  • 7.
    The Flash universeRuntimesAdobe® AIR®Adobe® Flash® PlayerThe Flash universeApplications, content, and videoToolsFrameworkServices/ServersAdobe Flash Platform ServicesAdobe® Flash® CS5 ProfessionalAdobe® Flex®Adobe Flash Media Server familyAdobe® LiveCycle® Data ServicesAdobe® Flash® Builder™
  • 8.
    FlashFlexUIs with componentsData-drivenappsServer-based appsEnterprise appsXML + ActionScriptRich graphicsAnimations with timeline Video-based appsGamesPresentation Title Version 1.0 02.24.09
  • 9.
    Access device featuresMultitouchand gestureAccelerometerScreen orientationMobile text inputDevice capabilities discoveryCamera – image and videoCamera app and camera rollMicrophoneGeolocationNetwork connectivityPresentation Title Version 1.0 02.24.09
  • 10.
    When you needAndroid SDKServicesBackground threadsHome screen widgetsContent providersFront-facing cameraIntentsAccessing core appsBroadcast receiversNotificationsStatus barPresentation Title Version 1.0 02.24.09
  • 11.
    Page 7Where's thedroid?Hint: Rhymes with peachPresentation Title Version 1.0 02.24.09
  • 12.
    AIR on whichdevices?Presentation Title Version 1.0 02.24.09
  • 13.
    When AIR isnot on the devicePresentation Title Version 1.0 02.24.09
  • 14.
  • 15.
    Adobe Flash BuilderBurritoAdobe Flash Professional CS5Flash Extension for AIRDesign and development toolmoto.ly/getflashcs5moto.ly/getextDevelopment toolmoto.ly/burritoPresentation Title Version 1.0 02.24.09
  • 16.
    AIR on thedeviceDownload from Android MarketOr install Runtime.apkPresentation Title Version 1.0 02.24.09
  • 17.
    The ActionScript classreferencehttp://moto.ly/getasref
  • 18.
    ActionScript and Javaboth …Are object-orientedHave packages, classes, and interfacesUse single inheritanceHave a base Object classAre strongly typedPresentation Title Version 1.0 02.24.09
  • 19.
    Comparing the syntaxof Java and ActionScript 3http://moto.ly/asjavaBut ActionScript has …Dynamic classesGet / set functionsNo method overloadingNo threadsPresentation Title Version 1.0 02.24.09
  • 20.
    The stageFirst, afew key conceptsPresentation Title Version 1.0 02.24.09
  • 21.
    Declaring variablesJavapublic intnumber;public Object foo = new Object();ActionScriptpublic var number:int;public var foo:Object = new Object();Presentation Title Version 1.0 02.24.09
  • 22.
    Declaring methodsJavapublic intadd( int first, int second ) { int sum = first + second; return sum; }ActionScriptpublic function add( one:Number, two:Number):Number{ var f:Number = one; var s:Number = two; var sum:Number = f + s; return sum;}Presentation Title Version 1.0 02.24.09
  • 23.
    DemoBuilding a firstappHint: Oolong teaPresentation Title Version 1.0 02.24.09
  • 24.
    AndroidManifest settings inapp.xml<android> <manifestAdditions> <![CDATA[ <manifest> … your tags here … </manifest> ]]> </manifestAdditions> </android>JavaPresentation Title Version 1.0 02.24.09
  • 25.
    Add permissions, forexample<android> <manifestAdditions> <![CDATA[ <manifest> <uses-permission android:name="android.permission.INTERNET"/> </manifest> ]]> </manifestAdditions> </android>JavaPresentation Title Version 1.0 02.24.09
  • 26.
    DemoDebugging on thedeviceHint: Tequilas, tacosPresentation Title Version 1.0 02.24.09
  • 27.
  • 28.
    The activity lifecycleIt'smanaged for you!Nothing to doPresentation Title Version 1.0 02.24.09
  • 29.
    The Back keyBackexits the app by defaultYou can access Back and define actionsPresentation Title Version 1.0 02.24.09
  • 30.
    Using the Backkeyprivate function onKeyDown(event:KeyboardEvent):void { if ( event.keyCode == Keyboard.BACK ) { event.preventDefault(); // do something }}JavaPresentation Title Version 1.0 02.24.09
  • 31.
    Detecting screen resolutiontrace("screenResolutionX:" + Capabilities.screenResolutionX);trace("screenResolutionY: " + Capabilities.screenResolutionY);JavaOn XOOMscreenResolutionX: 1280screenResolutionY: 800Presentation Title Version 1.0 02.24.09
  • 32.
    Detecting supported gesturesimportflash.ui.MultiTouch;if (Multitouch.supportsGestureEvents == true) { trace("Supported gestures" + Multitouch.supportedGestures );}JavaOn XOOMgestureZoom, gesturePan, gestureRotate, gestureTwoFingerTap, gestureSwipePresentation Title Version 1.0 02.24.09
  • 33.
    MultitouchMichael Chaizewww.RIAgora.comGreat resourcesGamesHemantSharmaCrazy Gemswww.hsharma.com/techGamesPaul TraniDoodle Galaxy Invaderspaultrani.comPresentation Title Version 1.0 02.24.09
  • 34.
    Okay, now …Wherewas the droid?
  • 35.
  • 36.
    MOTOROLA MOBILITY DEVELOPERNETWORKDetailed product specsPractical advice, technical articles, and documentationExpert support via forumsCommunity interaction via blogs, podcasts, and social mediaGlobal news, events, and training Web: developer.motorola.comTwitter: @motodev
  • 37.
    GET STARTED NOW!TestYour Apps on the MOTODEV App Validatorhttp://moto.ly/appvalidatorJoin the MOTODEV CommunityAsk questions, read our blogs, and networkhttp://moto.ly/joinmotodevJoin our live chat with technical experts at the MOTODEV Office Hours March 16 2pm PSTDetails at http://moto.ly/officehoursTwitter: @motodev#andevcon
  • 38.
  • 39.
    BSD LICENSEExcept whenotherwise noted, sample source code is provided under the following terms. Copyright (c) 2011, Motorola Mobility, Inc. All  rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the Motorola, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS  SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH  DAMAGE.
  • 40.
    APACHE 2 LICENSELicensedunder the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.