Tutorial for those living in a parallel universe

Good news folks! If you use Flash and live in an alternate reality where Apple and Adobe get along just fine then you’ll probably find this tutorial quite useful. It details how to get the best performance when writing apps with Flash CS5 Professional’s Packager for iPhone.

I suppose for everybody else there’s nothing stopping you using Flash to quickly prototype your apps before committing to Objective C. What’s written in my tutorial will also benefit those wishing to target the Android platform and shows how to take advantage of a device’s GPU to increase animation performance.

Sure glad I only spent 5 minutes putting the tutorial together. It would have been quite irritating if I’d spent a few weeks on it only to find out Steve Jobs had changed the developers license agreement rendering all my hard work useless.

So anyway, here it is:

Packager for iPhone: Render Performance

Introduction

CS5 is one of the most eagerly anticipated releases of Flash Professional in years and the inclusion of the iPhone Packager finally makes it possible for Flash developers to write exciting content for iPhone using the same tools they use day in, day out.

Mobile development requires special design and coding considerations, and the iPhone is no exception. Although the Packager compiles all ActionScript byte code into native iPhone application code, an understanding of the Flash rendering pipeline on iPhone will help you maximize performance.

This article will lead you through code examples detailing how to get the best results from your iPhone when performing frame-based animation.
Continue Reading

My First iPhone App!

Several months back I toyed with the idea of porting my audio cassette music player to iPhone using Flash Professional CS5’s iPhone Packager, and as you can see from the video below I’ve done just that. Although Apple are blocking content written in Flash from the App Store I still thought it would be a worth while exercise and would probably be fairly straight forward to do.

Well it turned out to be anything but straight forward. The wisest Jedi of them all once said “You must unlearn what you have learned” and I swear the more that quote floats around my head the more convinced I am that Master Yoda had actually tried porting projects to Apple’s shiny little wonder.

I naively thought that my Flash Lite experience would ensure I was up and running in no time at all. However writing for iPhone brings about a whole new set of interesting problems for the developer to solve. I’ve spent the last two days taking apart my original audio cassette demo and reconstructing it so as best to take advantage of the iPhone’s hardware.

Its GPU loves texture maps, so converting as much of your content as possible to bitmaps and caching them on the GPU seems to get some pretty good results. As is the case with all mobile development, finding the best approach may require you to make compromises and small sacrifices in order to get the best performance.

I think the end result was worth the effort and I now understand considerably more about development for iPhone.

Exciting new features for Device Central CS5

I’m a big fan of Adobe Device Central and have been using it over the years on various mobile projects. It really was a lifesaver when porting my GamesFlash project from S60 3rd Edition smartphones to the mass market Symbian Series 40 handsets. With their limited CPU and memory constraints, every byte saved mattered and optimising in order to gain maximum performance was critical.

Device Central’s huge catalogue of devices and its ability to accurately simulate the performance of these devices made it possible to test my code without having to spend a fortune on hardware. The Memory Inspector was an ideal way to check if my code was about to blow the heap on any one device, and was great for identifying areas of code that were consuming too much RAM.

However there have been some glaring omissions that Adobe are thankfully rectifying in Device Central CS5. For the first time you’ll be able to actually use the Flash debugger when running content within the device emulator. It’s hard to believe this feature wasn’t made available sooner but I’m delighted that it is finally making it into a release. The other great feature I’m forward to is the ability to emulate a device’s on-board accelerometer.

Take a look at the two videos from Adobe Platform Evangelist Mark Doherty as he gives a guided tour of some of these new features.

Online Flash Lite Packager is back!

Great news folks. Forum Nokia’s Online Flash Lite Packager is live again. To be honest I was starting to fear the worst but true to their word the boys and girls at Forum Nokia have wheeled out a new version.

So if you fancy converted any of your existing Flash projects to Flash Lite and selling them on Nokia’s OVI Store then now is the time. With OVI Store available to Nokia users in over 180 countries there’s the potential to generate some serious revenue. Now I just need to think up a good idea and I’ll be driving around in that Ferrari that I’ve always wanted.

Fight: Flash Player 10.1 v HTML 5

Here’s a video I’ve been meaning to post for a few weeks now. It shows performance comparisons for Flash Player 10.1 against HTML 5 across both the Mac and the Google Nexus One. In order to perform the test a simple particle engine was written that was easily translatable between ActionScript and Canvas. The tests weren’t actually restricted to Flash and HTML 5, with versions of the particle engine also being written in HTML and SVG.

The short answer is that Flash is still king but the other technologies, in particular Canvas, were catching up. Of particular interest was Flash Player 10.1’s performance on the Google Nexus One. The HTML 5 demo on the Nexus One was managing approximately 13 frames per second while the same demo running in Flash was hitting between 26-28 frames per second. Even running in Safari on the Mac the Flash demos outperformed the same HTML 5 demos.

All very interesting but admittedly the tests are hardly the most scientific. If you’re interested then jump over to Michael Chaize’s blog where you can find out more.

Flash for Android

It’s getting closer. The first public betas for both Flash Player 10.1 and Adobe AIR 2 for Android are almost upon us. If you’re interested then sign-up to be notified via the Flash Player 10.1 or Adobe AIR 2 beta pages. It’ll be interesting to see what the performance is generally like when browsing Flash content. Devices such as the HTC Desire have a 1 GHz CPU and should allow Flash to take advantage of GPU acceleration too, so fingers crossed that Flash Player 10.1 will perform respectably on mobile.

As for Adobe AIR 2.0. I think this is a really exciting opportunity for Flash developers to get their games and applications onto Android. If the video above is anything to go by then the performance looks pretty impressive. As you no doubt know, Adobe have been working very closely with various handset manufacturers to ensure the best possible experience for the end user.

Has Apple just nuked the Flash iPhone Packager?

So Apple has just changed its developer agreement for those wishing to access the iPhone Developer Program and it could spell the end for Adobe’s iPhone Packager before it has even been released. Here’s the worrying snippet:

3.3.1 Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited).

With Apple and Adobe not exactly being the best of friends at the moment it is very possible that this is another blatant attempt by Apple to make Flash irrelevant. Unfortunately these new terms and conditions would also have serious implications for the excellent Unity development platform too.

Fingers crossed it’s just a big misunderstanding.

Flash: One Web. Any Screen.

Well that’s the impression Adobe are trying to give with this pretty neat video that I spotted on Mark Doherty’s blog.

It’s not quite there yet but with the arrival of Flash Player 10.1 expect to see Flash on most tablets and many of the smart phone’s coming to market.

Improving Flash performance on Mac

Poor performance is probably one of the biggest complaints regarding Flash on Mac, but is anything being done about it or was Steve Jobs correct when he accused Adobe of being lazy?

Well after reading a post from Tinic Uro, an engineer working on the Flash Player, it seems that both Adobe and Apple have been feverishly working together to bring a faster Flash Player to the Mac.

What the Frak?! Apple working with Adobe! Yup, seems that Flash support for the Core Animation drawing model was originally driven by Apple and has had engineers on both sides working towards improving Flash performance on Safari.

For those that don’t know, Core Animation is an Objective-C framework that provides a high-performance compositing engine and animation API.

And for those wondering just how much this change will benefit Mac owners, the Adobe engineers believe they will get to the point where Flash Player for Mac will actually be faster than Windows for graphics rendering. For video rendering they expect to reduce the CPU usage on Mac to the point where it is almost identical to PC.

You can read Tinic Uro’s original entry on his blog and you might also want to check out this post from him explaining some of the performance gains.