Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building an iOS app with Adobe Flex Builder - Performance Issues

I'm building an app for iOS with Adobe Flex builder and compiling it into an .ipa using Adobe's tools.

Through initial testing, I see that the end result isn't as rich as native code, nor is it as fast or smooth.

Without simply saying 'why dont you just use objective-c', are there any documentation as to the overhead to building an app this way?

Specifically, what kind of performance hit can you expect when using Adobe's platform instead?

like image 239
barfoon Avatar asked Dec 10 '22 05:12

barfoon


2 Answers

Make sure you are using the latest AIR 3.0 SDK for iOS packaging. It is notably higher performance.

Consider best practices when developing your app:

http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html

http://help.adobe.com/en_US/as3/mobile/flashplatform_optimizing_content.pdf

http://www.mikechambers.com/blog/files/presentations/fitc_amsterdam_2010/flash_iphone_fitc_2010.pdf

Blanket comparisons to native Objective-C is a wide topic, to which capability of Flash ubiquitous deployment to multiple platforms should also be considered if you're targeting Android and BlackBerry.

Perhaps citing specific issues of your implementation would help yield insight.

like image 186
Jason Sturges Avatar answered Dec 11 '22 19:12

Jason Sturges


I too have been developing a Flash-based iOS app. My initial prototype was useless in an iPad 1. I had to look for ways to optimize. My second prototype is performing quite well. So here are some pointers.

1) Don't use timers. I had to write my own utility "FrameWorker" Singleton class to manage and delegate all my animations, or even delayed actions to a single enterFrame event. This alone will give you a huge speed boost.

2) Don't use many enterFrame events on different objects. As I said on point one, find a way to use a single enterFrame that you can add and remove processes to.

3) Avoid vectors as much as possible-use images. If you need to draw objects in the Flash IDE or via action script, use cacheAsBitmap = true.

4) Don't use visual objects that are much larger than the screen area. If you need to use large objects across the screen, then manage them off the display list and learn blitting techniques to draw to the screen ONLY the rect that will be display at that time. Lee Brimlow has a couple of good starter tutorials.

5) Be very disciplined about managing events. Make sure you always remove listeners that are not necessary anymore for instance.

6) Distribute your app's load to different frames. Don't do too many intensive things on a single frame.

If you follow these pointers your app will be as fast as any out there.

like image 42
izk Avatar answered Dec 11 '22 19:12

izk