Clever Adobe compilation trick sneaks Flash apps onto iPhone

By Scott M. Fulton, III | Published October 7, 2009, 4:52 PM

Up to now, Apple's prohibition against anyone's runtime modules from appearing on its iPhone without authorization has been one of two central reasons that Adobe's Flash video and Flash platform have not made their appearance there -- the other reason being simply that Steve Jobs doesn't like it.

But at its annual MAX developers' conference in Los Angeles this week, Adobe's engineers unveiled a surprise: It's planning a public beta release of Flash Professional CS5 that will go through a new and unique set of hoops to enable developers to write or export apps built for the Flash runtime, to run on the iPhone as native apps. The new Flash Pro will use a mechanism for Flash application developers to deploy their apps on the iPhone anyway, even without the Flash mobile runtime.

That mechanism is the evolution of an academic project -- namely, the work of the Computer Science Dept. at the University of Illinois-Champaign. It's an open source project called Low-Level Virtual Machine (LLVM), and it's a way to effectively bury the compilation element of a language interpreter below the application layer where the runtime module normally resides, deep into object code.

"On the iPhone, we don't have a browser plug-in. Flash Player 10.1 isn't available, and you can't browse to this application and just start using it," explained Adobe engineer Adrian Ludwig, in a company video released during MAX.

"So what developers have to do is go inside of Flash Pro, and they have to export that project to a native application for the iPhone. While you're using Flash Pro to build these applications, it's being converted from SWF down to IPA, which is the native file for applications on the iPhone. So it's installed -- there's no runtime interpretation, there's no JIT. These are applications that are built according to all of the rules that have been established in the iPhone developer program."

Adobe Flash engineer Adrian Ludwig demonstrates a Flash app appearing in Apple's iPhone App Store for the first time.

Seven Flash games have already been developed for iPhone, and have begun distribution this week through Apple's App Store -- a clear indication that these apps do follow Apple's rules.

As Aditya Bansod, another Adobe engineer, blogged on Monday, "We created a new compiler front end that allowed LLVM to understand ActionScript 3 and used its existing ARM back end to output native ARM assembly code. We call this Ahead of Time (AOT) compilation -- in contrast to the way Adobe Flash Player and Adobe AIR function on the desktop using Just in Time (JIT) compilation. Since we are able to compile ActionScript to ARM ahead of time, the application gets all the performance benefits that the JIT would offer and the license compliance of not requiring a runtime in the final application."

The downside of this architecture is that the hoops Apple made Adobe jump through, bypass the normal route an iPhone app would take to communicate with the iPhone itself. As a result, much of the iPhone API is inaccessible from within an exported Flash app; although Flash evangelist Mark Doherty presented an initial list of iPhone features that will not work in a Flash app, one gets the distinct feeling that it's not yet even an exhaustive list.

Which limits the class of Flash apps one can port to the iPhone to mostly games; and indeed, that's the focus of the first seven such apps that Adobe is demonstrating. As for rerouting Adobe's ingenious detour closer to the phone itself in the future, Doherty pointed to a future version of the company's Flex Mobile Framework, whose code-name "Slider" gives you a hint as to where it's directing at least one offshoot of its platform.

Comments

View comments by with a score of at least

While it's interesting, hopefully developers will find a way to develop native applications and bypass Adobe's software completely.

Other than Adobe, no one *needs* Flash. It's a drain on system resources, no matter the platform.

Score: 0

|

Steve Jobs getting more cranky with age

Score: 4

|

"Seven Flash games have already been developed for iPhone, and have begun distribution this week through Apple's App Store -- a clear indication that these apps do follow Apple's rules."

That line right there is more and more hilarious each time I read it. Flash games, on the App Store, for a device that Apple refuses to allow Flash to run on... and they're not being rejected.

Well, it's clear that these do not duplicate functionality. =)

Score: 0

|

I believe Apple will find a way to not let this happen on the platform. Looking at the bigger picture one can see that Apple has gained its popularity among the developer community. Many developers have migrated to the Apple because it is necessary to have XCode which runs only on OS-X. This helps sell machines.

The ability to have iPhones apps compiled outside of the Apple OS-X is going to change this. I think there will be more of a stink before this is over. Apple has built a strong development community that takes pride in their newly acquired skill set.

A good way for Apple to circumvent this would be to have an ECME script attached to Quartz with an adaptation layer that emulates Flash functionality. This would allow for easier migration of Flash Apps to the iPhone and still require an Apple machine to compile the code.

my 3 cents

Score: 0

|

It's because they aren't "Flash" games. They were developed using Flash, but they are running on the iPhone as 100% native apps. It's more like a framework that allows you to develop in Flash, which a lot of developers are comfortable with, on your own machine, then turn it into a native app for the iPhone.

Still, I don't think it's clear that Apple *likes* this--you don't get native widgets, and Apple seems to have made it clear in the past that they don't like frameworks. But there's nothing about this that makes it actually Flash running on the iPhone.

Score: 0

|

Google Buzz: Another attempt to harness the content firehose

Similar to how Google successfully remolded RSS into a Google tool, the company now wants to remold Gmail into one big Google party

Success: Google's Nexus One shipping support line takes tech support questions

UPDATED Though the support line had been set up for shipping, it now appears Google personnel are happy to hear technical concerns.

Goodnight, moon: What I learned from a space shuttle

Carmi Levy | Wide Angle Zoom: Can the tech sector learn a few lessons from the space program? Certainly, if you believe in learning from someone else's mistakes.

Netflix to FCC: NBCU + Comcast could bypass net neutrality

Weaning itself from the post office as its main means of video transfer, Netflix would like someone to ensure the Internet remains just as unencumbered.

Rhapsody to become an independent company

RealNetworks and Viacom subsidiary MTV Networks have begun the process of spinning off music service Rhapsody into an independent company.

Nvidia debuts new dynamically-switched graphics card technology

Today, Nvidia announced that its Optimus technology for GPU switching will soon be available in a handful of Asus notebooks.

Google lowers 'unusually high' early termination fee on Nexus One

Google has lowered the Nexus One's early termination fees which were twice as high as the norm.

Netgear and Ericsson introduce a mobile broadband hotspot with a twist

It's a mobile broadband hotspot, but it's for use in the home.

Report: Streaming video drove 72% global increase in mobile data consumption

A new study says streaming video is "the single most influential factor driving the need for increased mobile network capacity."

Stymied by continuing Nexus One 3G issues, Google blames the environment

If you're still afflicted with the 3G flip-flop trouble, then you might consider moving. That appears to be the only suggestion Google can give for now.

Wolfram|Alpha makes a strong argument for virtual keyboards

"Answer engine" Wolfram|Alpha has updated its iPhone/iPod Touch app, harnessing the strength of the virtual keyboard.