Hands On with Flash Builder 4.5.1 for Apple iOS

Flash 4.5.1 has been released recently, the first with integrated support for Apple iOS as well as Google Android and RIM Blackberry Tablet OS. I was keen to try my calculator app on iOS, having already tested it for Android. You can do most of the development on Windows, but I moved the project to OS X so I could try it in the iOS simulator and then on an actual iPhone 4.

Adding iOS as a target platform was easy: right-click the project, choose Properties, check to add the platform.

image

Then I worked on the UI. The buttons on my design were too small. The answer I guess is to use relative sizes, but I thought for a quick test I would simply set the device to Apple iPhone 4 and resize the layout for that.

image

After a bit of tweaking I got the app working nicely in the iOS simulator, again set to iPhone4. I was also able to set breakpoints and debug the app easily.

image

Then I tried it on the device. I did the Apple provisioning dance. I then compiled a release build, which took a long time and featured a thermometer that stuck on zero the entire time. It worked though, and I got the app into iTunes and synched.

On the device the app did not look too good.

image

Well, I have read up on supporting multiple screen sizes and on setting mobile project preferences and I am still not sure why this did not work, especially as it looked OK in the simulator. I had auto-scaling on, and the docs say:

When you enable automatic scaling, Flex optimizes the way it displays the application for the screen density of each device.

I fixed the the immediate issue though by adding the attribute applicationDPI=”320” to the ViewNavigatorApplication element.

Now it works fine.

image

So how is performance? I have managed to create some rather poorly performing calculator UIs in my various tests of cross-platform mobile tools, and this is one of the better ones, though not as responsive as the Titanium app on iOS. However the Flex app is more consistent across Android and iOS, whereas Titanium was poor on Android. Loading takes a few second, but it is acceptable. The app size is only 6MB which is not bad, considering that the necessary bits of Adobe AIR are compiled into it.

Note that this is little more than a Hello World app. My reasoning is that if this does not work well, then nothing will.

So far I am encouraged. Taking into account the development experience and performance across both Android and iOS, this is one of the best I have tried so far with my simple example.

2 thoughts on “Hands On with Flash Builder 4.5.1 for Apple iOS”

  1. Hi

    Could I know how you got the packaged ipa to work on the iOS simulator ? As in, Flash Builder packages an ipa ready for iTunes distribution right ? How did you get this working on the iOS simulator ?

    Thanks,

    Bala

Comments are closed.