Transcript
Android App Development with Hero and Burrito
var location: Geolocation = theRedspace;Mo Farajmandi::
mo.farajmandi@theredspace.com
Overview• Build a basic Flex Mobile app
• requirements : Hero + Burrito
• Types of Mobile Application
• Supported (i.e. Mobile Ready) Components
• View & Navigation
• Run on Emulator, or on Device
• How to use mx based components?
• How to handle orientation change: Portrait vs. Landscape
• Trigger Built in Phone features
• iPhone export via iPhone packager
Types of Flex Mobile Application
Mobile Ready Components
View and Navigation
• Main Components of Interest:
• spark.components.View
• spark.components.ViewNavigator
• General interaction between the view and navigator via pushView, and popView.
View• Drives from Spark Group has two parts ActionBar and
Main View
• Displays an ActionBar containing:
• navigationContent,
• titleContent,
• actionContent
• Useful Events: viewActivate, creationComplete
• Useful Properties:
• overlayControls
• tabBarVisible
• actionBarVisible
ViewNavigator•pushView, popView
•Passing Data Between Views
•pushView(ViewClassName, data);
•returning data on popView() by overriding createReturnObject()
•actionBar Visibility Effect
• transitionEnabled
Orientation Change
• FlexGlobals.topLevelApplication.stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, orientationChanged);
• Use States to change view
URI Handlers in Air for Android
• navigateToURL(new URLRequest("tel:90244434"));
• navigateToURL(new URLRequest("sms:4085366000"));
• navigateToURL(new URLRequest("mailto:mo.farajmandi@theredspace.com?subject=Question"));
• http://blogs.adobe.com/cantrell/archives/2010/11/uri-handlers-in-air-for-android-phone-calls-email-text-messages-maps-and-urls.html
iPhone Export?!
•Download iPhone packager
•You may need to compile in command line
• "${FLEX_HOME}/bin/mxmlc" -load-config "${FLEX_HOME}/frameworks/airmobile-config.xml" -compiler.include-libraries+=libs -sp src -o bin-debug/FaceFun.swf src/PlayerMobile.mxml
• Not usable on iPhone 3G, Ok, on iPhone4
Burrito Code Productivity
•Code generation (also existed in Flex 4)
•Code Templates + Ctrl+1
Conclusion
•Very easy & FUN to play with
•Not everything will work right away, but you can get most of your code running.
•Some components/utilities may need tweaks but it’s usually minor.
top related