Opportunities and Limitations of Flex Development for iPhone

Igor Razhnov

Two weeks ago, my colleague tested the preview releases of Flex SDK and Flash Builder that feature new components for cross-platform mobile development. He published a Web-based Flex application for Android and iPhone. Nick checked that all of the libraries functioned seamlessly, and made sure the application supported accelerometer, multi-touch, and gestures.

I decided to take a step further. Using these preview versions, named “Burrito” (Flash Builder) and “Hero” (Flex SDK), I built a Flex application for Android 2.2. Then I decided to compile this application on the iOS platform with the Adobe’s Packager for iPhone. I wanted to see how Flex application supported the built-in camera, microphone, and GPS. I also wanted to check how it interacted with the Web.

Packager for iPhone

The Packager for iPhone based on Adobe AIR® SDK 2.0.1 enable developers to re-use the existing code from ActionScript 3 projects to create native applications for iPhone. Earlier this year, Apple has banned “applications that link to Documented APIs through an intermediary translation or compatibility layer” from the AppStore. These restrictions forced the Adobe’s team to freeze the development of the packager.

In September 2010, Apple loosened the restrictions in the developer agreement. Now it is possible to convert applications based on ActionScript 3 code to iPhone apps as long as they do not download any code. Nevertheless, the Flex SDK still doesn’t offer rich support for development under iOS, as compiling applications with the packager (which is also a preview version) limits development options.

What you can and can’t do with the packager

My investigation revealed that the Flex application on iPhone supported the following features:

    • Switching between the application and the phone mode to make calls and send SMS
    • Uploading and sending graphics and text data using HTTP requests
    • Building menus, tables, interactive networks, and diagrams
    • Utilizing Web services in full—I tested how the application worked with Twitter, and it ran perfectly.
    • Launching and watching video files

The application failed to access some built-in features of the iPhone:

    • With the Packager, I faced some difficulties when trying to get access to the camera and the microphone. It seems like the tool still cannot exchange data with these APIs.
    • I didn’t receive the coordinates through the built-in GPS. Though the test demonstrated that its API was available, it was not active.

In addition, there were some performance issues when comparing my Flex app against a native iPhone application:

    • The Flex application runs slower than the native application.
    • Its size is 2-3 times bigger than the size of a similar native application.

Finally, as the development of the packager for iPhone was frozen for half a year, it still lacks the functionality to convert complex Flex applications to iOS. Interaction with the APIs of a built-in camera, GPS, and microphone is already incorporated, but not yet working.

I believe Adobe will improve the support for iOS development soon. It would be great to have a full-featured interface for developing iOS applications in Flex, like the one AIR provides for Android. It’s good news that most of the components have been optimized for working with mobile devices, and I also hope that the final (beta) release will have the rest of the components optimized, as well.

Anyway, it is already possible to build cross-platform Flex applications for iPhone even with this functionality.


Download Benchmarks and Research

© 2001 – 2019 Altoros