Opportunities and Limitations of Flex Development for iPhone

by Igor RazhnovDecember 3, 2010
This blog post explores how to build cross-platform Flex applications for iPhone with the existing Adobe functionality.

Previously, the team at Altoros explored the preview releases of Flex SDK and Flash Builder that feature new components for cross-platform mobile development. As a result, the team published a web-based Flex application for Android and iPhone. Our experts checked if all of the libraries functioned seamlessly and made sure the application supported accelerometer, multi-touch, and gestures.

Now, we decided to take a step further. Using the preview versions—Burrito (Flash Builder) and Hero (Flex SDK)—our developers built a Flex application for Android 2.2. Then, we compiled the application on the iOS platform with the Adobe’s Packager for iPhone. In this blog post, we explore how the Flex application supported a built-in camera, microphone, and GPS, as well as how the system interacts with the web.

 

Packager for iPhone

Packager for iPhone based on Adobe AIR SDK 2.0.1 enables developers to reuse the existing code from the ActionScript 3 projects to create iOS-native applications. Earlier this year, Apple has banned applications that link to App Store Connect APIs through an intermediary translation or compatibility layer from the App Store. These restrictions forced the team at Adobe 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 the ActionScript 3 code to the iPhone applications, as long as they do not download any code. Nevertheless, the Flex SDK still does not offer rich support for development under iOS, as compiling applications with the packager (which is also a preview version) limits development options.

 

Operations the packager performs

Our 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
  • Fully utilizing web services (e.g., Twitter)
  • Launching and watching video files

However, the application failed to access some built-in features of the iPhone.

  • With the packager, we 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.
  • The coordinates are also cannot be received via 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 our Flex application against a native iPhone application.

  • The Flex application runs slower than the iOS-based application.
  • Its size is 2–3 times bigger than the size of a similar iOS-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 working yet.

Adobe is likely to improve the support for iOS development soon. It would be great to have a full-featured interface for developing iOS applications in Flex, as the one AIR provides for Android. It is good news that most of the components have been optimized for working with mobile devices. We 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.

 

Further reading


The post was written by Igor Razhnov and edited by Alex Khizhniak.

  •  
  •  
  •