Building Applications for iPhone with Adobe Flash CS5

Flash-CS5-Iphone-max2009

badsonAditya Bansod – Adobe now makes it possible to create applications for the Apple iPhone using the Adobe Flash CS5. You heard right: We’re really excited to bring this new capability to Flash designers and developers—the ability to target the iPhone with ActionScript 3 projects.

As you know, the Apple iPhone is one of the best selling consumer electronic devices of all time, and the fastest selling smartphone ever. The popularity of the device among developers and consumers created an explosion of over 85,000 applications that captured the attention of consumers around the world.

Flash developers told us how eager they were to create apps for the App Store, so we sought a way to make it easy for our community to bring their knowledge and creative talents there. After looking at the software terms, agreements, and allowable content that Apple permits in the store, we decided that our best option was to provide our developer community with a compiler to help package SWF content into a native iPhone application. (Of course, we made sure we did this in a way that aligned with Apple’s legal terms.)

Learn how Adobe is working to bring Adobe AIR development out of the desktop and onto a mobile phone near you. We will cover how the AIR SDK and platform will evolve to add capabilities to help developers mobile enable, test, and publish their content.

Start from time: 4min 30sec

How it all works

We enabled this by using the Low Level Virtual Machine (LLVM) compiler infrastructure. LLVM is a modular, flexible compiler system that is used widely in a variety of projects. The key reason we choose LLVM is its flexibility and applicability to iPhone development.

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.

By doing the compilation step, we allow developers to create applications using their Flash skills and their knowledge of ActionScript 3. In the process, we also expose the APIs that developers are familiar with so they can not only use the ActionScript language but follow the customary app-building model. When you build your application for the iPhone, there is no interpreted code and no runtime in your final binary. Your application is truly a native iPhone app.

Apps for the iPhone

So how do you build an application for the iPhone? It’s simple, really. The forthcoming beta of Adobe Flash Professional CS5 incorporates the ability to create an iPhone application. You have access to nearly all the AIR 2.0 and Flash Player 10.1 APIs. For example, you can use APIs such as RTMP, Remote Shared Objects, and AMF as well as AIR APIs like SQLite and filesystem access.

Start by creating your application on the desktop that fits the screen size of the iPhone. The iPhone’s display (like many smartphones) is 320 × 480. When the app is not in full-screen mode, 20 pixels are taken up by the status bar, so consider that when building your application.

Second, your finger is your pointing device. You can use mouse events (and touch events) to track the user’s intent, but remember that the finger is an inaccurate pointing device. Sometimes a finger goes down on the screen but moves up elsewhere. Certain behaviors that you may often employ in desktop application development will not necessarily apply to the iPhone.

The third and most important consideration when building your application is performance. Performance, performance, performance! The iPhone is most decidedly not a desktop computer. It has very powerful and sophisticated hardware, but there is a wide spectrum of capabilities between the different generations of device, the amount of memory available, and the amount of processing power your application has at its disposal.

If you have any experience developing applications with Adobe Flash Lite or other mobile platforms, you can use many of the same tricks and techniques—such as caching bitmaps, limiting the display list depth, and so on. In order to make development of high-performance applications easier, applications built for the iPhone also can take advantage of an augmented rendering pipeline that uses OpenGL ES. This augmented rendering pipeline enhances the Flash rendering model to allow developers to take advantage of the GPU on iPhones. By enabling this rendering path, you have the ability to modify your display objects to put them on a hardware surface. There are many pros and cons to choosing this rendering path, so for more information see the developer FAQ on Adobe Labs.

Once you’ve built your application, you can deploy your app on the iPhone or iPod touch for testing and tweaking via iTunes. Once you’re satisfied with your application, sign it with your distribution certificate and upload it to iTunes Connect. That’s it! You’ve made an iPhone application using Flash.

Share


16 Responses to “Building Applications for iPhone with Adobe Flash CS5”

  1. This is wonderful news. I have been debating about developing for the iPhone for a while. Being able to use my existing Flash skills and not have to learn another language or even work on a Mac is awesome.
    Not that Mac’s are bad, simply my setup at work and at home is PC based and this takes having to compile on a Mac out of the equation. Thank you Adobe!!

    Current score: 0
  2. David O. says:

    My concern is if the keyboard and/or control pad controls translate well to the ipod touch/ iphone on screen controls.

    Current score: 0
  3. ThatGuyThatSmellsALittle says:

    Will you have to be on a Mac to compile?Similar solutions like Titanium require you to be on a Mac because it needs to use the Apple SDK to build your App. If not this will be awesome.

    Current score: 0
  4. Chris says:

    Listen at around 5:15 he mentions PC development without Mac.

    Current score: 0
  5. Steven says:

    This is very cool, but I am curious, will it only publish Flash Apps that can be downloaded in the App store, or will it also allow you to publish Flash Apps that can be embedded in Safari for iPhone/iPad?

    Current score: 0
  6. Tyler says:

    This is cool and all, but what about flash from the web? That’s what I’m waiting for

    Current score: 0
  7. Rvdb says:

    Still waiting for the flash plugin for mobile safari

    Current score: 0
  8. Chris says:

    There will never be flash on the iphone/ipod. Apple is in the business of making and selling apps. Allowing Flash would cut off that revenue or at least decrease it by a major percent. It’s called business, simple as that wether you like/agree with Apple or not.

    Current score: 0
  9. Michael says:

    Can I access the iPhone camera from a Flash developed app?

    Current score: 0
  10. This is incredible, the dream of the Flash platform developers is to develop applications for iPhone (at least mine is), thanks to the work of the great minds in this business, we can, thanks.

    Current score: 0
  11. LX says:

    Apple will never support flash…they are working on HTML5 instead

    Current score: 0
  12. Eduardo says:

    What about using Flash to develop apps for the Droid operating system?

    Current score: 0
  13. woodo says:

    So close and yet so far……

    Current score: 0
  14. vis says:

    while this is great news on the surface apple has announced that they will not let developers use other software apart from their SDK to develop apps. Apparantly they are’sub-standard’

    I think that Adobe should deley shipping until they have reached an agreement with apple about the iphone building application. Many good apps will be turned down as they have not been made with Apple’s software.

    Current score: 0
  15. Eric says:

    I love Adobe products, Premiere, Photoshop, AE but Flash for iPhone just not going to happen, sorry Adobe.

    Current score: 0
  16. Building iPhone Apps is being widely touted as the latest greatest way to making an untold fortune on the internet. Unfortunately not all of us are able to do hte development work, although we got great ideas. How do you propose going about getting somebody to develop your idea into an iPhone App, without the developer plagiarising your idea?

    I’d love to hear your take, guys.

    Regards

    Jacques

    Current score: 0

Leave a Reply


8 + = seventeen