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

|

PDC 2009: What have we learned this week?

There was the freebie that no one will forget, the heebie-jeebies courtesy of Scott Guthrie, and a teensy bit clearer picture of how this cloud thingie should work.

Live report: Will Google Chrome OS change Linux?

The mysteries of just what Chrome OS is, and how much of an operating system it truly is, may be resolved today.

PDC 2009: Microsoft cares about Web browser performance

The effort to give users of the world's dominant Web browser the impression of quality, is a personal one for the man who leads that battle.

Nokia re-affirms its commitment to Symbian, sort of

Maemo won't necessarily be replacing Symbian in the Nokia N-Series, but that's definitely a place where it will be found.

E-book readers will be in short supply this holiday season

E-readers are hot this year, and a lot of compelling new products have been released, but are there enough electrophoretic displays to go around?

Sony looks to finally open a single storefront for downloads

Sony has had many different download portals for movies, music, e-books, and games, and now it's looking to make a single shop for all of it.

Tuning out the tablet: Time to give the endless speculation a rest

Wide Angle Zoom: Wishing and hoping and thinking and praying....won't put an iTablet on the market.

Five improvements for IT managers in 2010

If businesses are to improve their efficiency for next year, they need to stop and reassess the basic tenets of their job.

AOL's spinoff from Time Warner to shed 2,500 jobs

As AOL moves toward become an independent company again, it will cut nearly a third of its workforce.

Gartner: SMS-based money transfer will be bigger than mobile browsing, search

Gartner issues its predictions for the 10 things our phones will be doing in 2012.

Don't forget to upgrade to Firefox 3.6 beta 3 today

Mozilla has released the latest beta its Firefox 3.6 browser software, just over one week after beta 2.