« Social Applications with Adobe Flash Collaboration Services (RIA Unleashed: Boston 2009) | Main | Building Flex Applications with the Swiz Framework (RIA Unleashed: Boston 2009) »

Building iPhone Applications with Flash CS5 (RIA Unleashed: Boston 2009)

Ryan Stewart (Using Mike Chambers' Slides)

What did Adobe announce:
Adobe Flash CS5 can create native stand-alone iPhone Applications
Flash Player 10.1 that is smartphone enabled (see keynote)
Did not announce Flash Player for Safari Mobile on iPhone.

Flash based iPhone applications exist today

LLVM (Low Level Virtual Machine) previous used in Alchemy
* Open source compiler with optimizations for any input language
* Capable of generating machine code for various targets
Front-end (SWF/ABC) -> LLVM -> Back-end (ARM)

Just like building an .air but with the descriptor capturing additional iPhone .app properties.

Flash Pro CS5 -> SWF, app.xml, app:/resources & Apple Certificates -> ADT -> .ipa

ADT does ahead of time (AoT) complication. Can't do JIT so you need to bundle code in, compiles ABC byte code from SWF and then pass through LLVM

Can use Flash Player 10.1 and Adobe AIR 2.0 APIs to get access to:
* MultiTouch
* Screen Orientation
* Media Library
* Accelerometer
* Geo-Location
* Cut, Copy, Paste
* Native rtextinput
* tel:, mailto: maps:, video:
* AMF, Flash remoting, RTMP

Can't do these
* Keyboard events outside of textfields
* Rollover or Hover
* ActionScript 1 or 2
* Loading SWF with ActionScript
* LocalConnection
* PixelBender
* H.264 and Speex codecs
* Microphone / Video Camera access

Still need to go through Apple certificate process, public key request, key signing request, application provisioning, etc.

Demo of Flash CS5 iPhone development process.

This allows you to build iPhone applications on Windows.

Current application use software rendering, latest releases are using GPU which will be part of the first public release.

Lots of tips and tricks for getting Flash based applications to perform well on an iPhone.

iPhone isn't like a Mac G5, much less power and performance so you need to think about your application development differently.

Device fonts for input fields, Helvetica is default.

Primary input is a finger (less accurate than mouse, larger hit area, no modifier keys, obscures the screen) 44x44 pixel recommended hit area size.

Text Input is the only component that launches virtual keyboard (get undo, magnifying glass, cut/copy/paste all work)

Resources
* bit.ly/arnoiphone
* bit.ly/mobilehig

Code Optimizations
* Improve performance and memory on desktop
* Some are AOT specific
* Test and profile in Flash Builder
* Grant Skinner Testing harness bit.ly/as3performance
* Reuse Instances
* Cleanup unused event listeners (especially ENTER_FRAME and Timers)
* Event dispatching can get expensive (use callbacks instead)
* Disable unused mouse events (don't use mouse_move use interval checks instead) or use mouse_down/mouse_up instead

Lots more information at www.mikechambers.com

Tags: flash iphone riaunleashedboston2009