10
votes

So I want to build Android & iPhone apps. I'm somewhat confused at the different options available with Adobe. I understand that there is a product coming out, Adobe Flash Builder 4.5 that will allow cross platform mobile development using Flex and Actionscript. Now I have Adobe Flash CS5, and when I create a new project it gives me the option to make an iPhone something. Can I build iPhone/android apps with Flash CS5? If so, how? Else what do I need?

3

3 Answers

9
votes

You can build iPhone apps from CS5 without any other tools by creating a new iPhone project. However, in order to target android and get the latest performance improvements for iOS, you should be using Adobe AIR 2.6 and the ADT. The ADT can only be used from the command line currently, though it will be integrated into Flash CS5.5 and Flash Builder 4.5.

The ADT accepts an AIR SWF file as input and the AIR 2.6 namespace can be specified in the app descriptor xml file. This means it is possible to target Android and iOS from Flash CS5 by creating an air project, specifying the AIR 2.6 namespace in the app descriptor xml, and then using the ADT to package the apps. The two platforms vary a little in what is required in the app descriptor and the command line options used are slightly different. Additionally the iOS platform requires an active iOS developers certificate.

Information on the command line options used in the ADT on the iOS certificate requirements can be found here.

UPDATE - Here's a quick run through of setting up a FlashDevelop workflow for Android and iOS development.

First download FlashDevelop and allow it to automatically download and install the latest Flex SDK. The default path is C:\Program Files\FlashDevelop\Tools\flexsdk\bin. Once you have FD up and running, download and install the AIR 2.6 SDK which includes the ADT used to create native mobile applications. To install the AIR 2.6 SDK you extract it into the Flex SDK folder, overwriting any changes.

Make sure you can compile SWFs using FlashDevelop. There are a few different paths you can go down to build your SWF, probably the easiest to get started if you're familiar with Flash is using Flash Professional to compile. Make sure you set up your FLA to use ActionScript 3 and target Flash Player 10 (this should actually be set to AIR 2.6 but the Flash CS5 IDE doesn't support it).

Alternatively you can use Flash CS5 for asset management only or avoid CS5 altogether and embed assets directly into your AS3 code. The FlashDevelop forums are probably the best place to find this info.

Once you have SWFs compiling, you can set up your application descriptor xml (additional mobile specific info here). You will also require a developers certificate to create Android apps, and a developers certificate and mobile provisioning file to create iOS apps. Once you've got all the necessary pieces (SWF, App descriptor file, developers certificates and provisioning file) you can use the ADT to package your swf file into a native app. The ADT is a command line tool found in the AIR 2.6 SDK (now in your Flex SDK directory).

The command line structure I use to test on android is:

adt -package -target apk -storetype pkcs12 -keystore "path/DevelopersCertificate.p12" -storepass DevelopersCertificatePassword "path/AppName.apk" "path/ApplicationDescriptor.xml" "path/SourceSWF.swf"

Some sources I've seen specify an .air file as the input. This isn't necessary. A swf works fine.

And for iOS:

adt -package -target ipa-test -provisioning-profile "path/Your.mobileprovision" -storetype pkcs12 -keystore "path/DevelopersCert.p12" -storepass DevCertPassword "path/AppName.ipa" "path/ApplicationDescriptor.xml" "path/SourceSWF.swf"

There are additional command line options you can use to specify app icons and other external assets that can be found here.

I recommend creating a batch file to call the ADT for both Android and iOS once you've got the command line options sorted. This lets you build for two platforms with one click. There is a way to call the ADT from FlashDevelop, but I found that the batch file is easier to create and maintain.

UPDATE 2 - This answer is quite outdated now. FlashDevelop now does most of the grunt work for you including downloading the latest SDK and handling the ADT options. I strongly suggest you check it out if you're interested in mobile development using actionscript.

2
votes

You can do it with notepad and the command line if you wanted. They are just different IDEs, and a matter of personal preference.

Personally, I detest writing code in flash CS5. It was not at all designed to be used as an application development tool. It sure does make pretty animations though. :)

edit

You may need to wait for CS5.5 for any built in GUI support. However, there is nothing stopping you from building an AIR app and running the packager on the compiled result.

0
votes

I think that an application based on Flash in Android or Iphone device, consumes more power. That's why all the developers try to build an application with HTML 5 which more comfortable and less coast in point of view power and alimentation.

Also, you have to know that Flex project is not for Adobe now !

Adobe is abandoning Flex SDK and putting it out to Apache, perhaps to die, or to enforce this project. To be followed ...