New to mobile development? Wondering how mobile applications are built? This presentation will walk you the entire development process of the AIR for Android application from design to deployment. Chris Griffith will show you how he designed and built the application using a variety of tools and techniques.
15. Data based on respective products published technical specifications Pixels Per Inch (PPI)
16. AIR for Android Overview GeoLocation Accelerometer Camera Multitouch/ Gesture Support Screen Orientation Microphone GPU Acceleration SQLite DB No Native Widgets No Multiple Camera Support No Access to Contacts Limited SMS Support
17.
18. ADB – Android Device Debugger installs apps on your device
19. DDMS - Dalvik Debug Monitor for desktop simulation.
26. Geolocation var geo: Geolocation; if (Geolocation.isSupported) { geo = new Geolocation(); geo.addEventListener(GeolocationEvent.UPDATE, updateHandler); geo.setRequestedUpdateInterval(10000);} else { log.text = "Geolocation feature not supported"; }
27. 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 }}
28. Orientation stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; function setPosition():void { vidHolder.x = stageWidth/2 - vidHolder.width/2; vidHolder.y = stageHeight/2 - vidHolder.height/2; //If the layout is vertical if (stage.stageWidth < stage.stageHeight) { //Adjust graphics } } setPosition(); stage.addEventListener(Event.RESIZE, resizeLayout); function resizeLayout(e:Event):void { setPosition(); }
40. Graphics Consider bitmaps over vectors Keep bitmaps as small as possible Minimize number of vectors Test your animations with different qualities of Stage Avoid, if possible: Filters Blend modes Transparency Perspective distortion
45. Display Objects Use the appropriate type of display object Objects that aren’t interactive, use Shape(); trace(getSize(new Shape())); // output: 216 Interactive but no timeline? Use Sprite(); trace(getSize(newSprite()));// output: 396 Need animation? Use Movieclip(); trace(getSize(newMovieClip()));// output: 416
46. Freeing Movieclips Alpha? RemoveChild? Visible? Even when removed from the display list, the movie clip still dispatches the Event.ENTER_FRAME event. runningBoy.addEventListener(Event.REMOVED_FROM_STAGE, deactivate); function deactivate(e:Event):void { e.currentTarget.removeEventListener(Event.ENTER_FRAME, handleMovement); e.currentTarget.stop(); }
48. Hero in a Nutshell: Mobile Application Development Allow developers to create a single mobile project that will run on multiple mobile environments UI components supporting touchscreen interaction Application framework fitted with common mobile UI patterns Interactive performance tuned for mobile devices