Join Anastasia McCune for an in-depth discussion in this video Exploring captive AIR runtime support for Android, OS X, and Windows, part of Flash Professional CS6 New Features.
Up until AIR 3.0, all AIR applications deployed to the Desktop or to Android required the third-party AIR runtime. Basically a user would have to download and install the AIR runtime one time only, and then be able to use it for any other AIR application they chose to install later. You may know that this isn't true for mobile apps for iOS devices. AIR apps for iOS are completely self- contained based on the way iOS works. They don't require a third-party runtime.
Instead they utilize captive runtime which means that all necessary components of the AIR framework are bundled into a self-contained compiled distributable app with no dependencies on any other SWFs. With AIR 3.0, AIR developers were given the option to create captive runtimes for Android and Desktop, basically to be able to bundle the AIR framework into a self-contained entity and eliminate the third-party dependency, and now in Flash Professional CS6 you can do the same thing.
So let's look at where to set this. I have opened Monster.fla from my exercise files and right away I am going to go to the Property Inspector. Let's start with publishing for Android. So next to Target, I am going to make sure that AIR 3.2 for Android is selected and then click on the wrench icon to inspect the settings. The place we need to be is on the Deployment tab. Here under AIR runtime, we have the old choices of getting the AIR runtime from either Google Android Market or the Amazon Appstore.
And of course the new choice of Embed AIR runtime with application is obviously the radio button just about this. Let's go ahead and publish this with Get AIR runtime from Google Android Market to get an idea of our file size. So I will need to make sure the location of my p12 certification file is set, and I will type in my password, and I will check to remember my password for this session. Let's click back to the General tab and note that the name of our file is going to be MonsterMatchUp.apk.
Let's make sure this is set to Landscape view and that everything else looks good and then let's go ahead and Publish. You might get this warning but don't worry about it. It means that we just didn't check a certain check box over in the Permissions tab. You can just click OK. So once that's done, let's publish again as a captive runtime file. So I'll change the name of our Output file to MonsterMatchUpCaptive, then back on the Deployment tab, I am going to select Embed AIR runtime with application, and then Publish, and again if you get this warning just click OK.
I will cancel out of the Publish box and now to our File Explorer. Let's compare the size of MonsterMatchUp.apk at 1.7 MBs about to MonsterMatchUpCaptive.apk at over 10 MBs. So there is a good illustration of the pros and cons. With MonsterMatchUp, users have to go to the Android Market or Amazon Marketplace, and download AIR before running our app if they don't already have it. But the file size is obviously smaller than the captive runtime version, since it's not carrying around all the AIR libraries.
The captive runtime version alleviates the need to download AIR separately before one installs the application. So you should pick which one best suits your user experience. Back to Flash, in our Properties panel, let's change the target to AIR 3.2 for iOS, and then open the Application Settings by clicking the wrench icon. When you go to the Deployment tab, you'll notice those options for embedding the runtime aren't there and this makes sense. Remember that iOS uses captive runtime by default just in the way it's structured.
So we don't have the option to choose it here, but if we cancel out of this and change our target to AIR 3.2 for Desktop, you'll notice we have the options for captive runtime here. For Desktop they appear right here on the General tab, and you can see the choices of outputting as an AIR package, which can be installed on Mac or PC, but the end user will need to get the runtime if they don't already have it. Windows installer is an EXE file and is captive runtime for Windows.
Application with runtime embedded, an APP file is captive runtime for OS X on the Mac Desktop. So there you have it. Ultimate control over deciding if you want users to have to download the AIR runtime before installing your apps or having a captive runtime with the AIR functionality all wrapped up within it. The biggest thing to remember is that you have this choice for projects deployed via AIR to the Desktop on Mac and PC, but on mobile you only have the choice for Android, as iOS devices are essentially captive runtime by nature.
- Creating PNG sequences and sprite sheets from the Library and the Stage
- Using scripts to export PNG sequences or sprite sheets
- Using Direct Window Mode publishing for Stage3D
- Exploring the captive AIR run time for Android, OS X, and Windows
- Using the new Content Simulator