AIR 3.0 Captive Runtime

If you hadn’t heard yet, Beta 2 of AIR 3.0 and Flash Player 11 are now availabe on Adobe Labs. The AIR 3.0 beta release is sporting some great new features, including hardware accelerated video playback for mobile, iOS background audio, android licensing support, front-facing camera support, encrypted local storage for mobile, H.264 software encoding for desktop applications, and last, but not least, captive runtime support for desktop and Android applications.

If you are wondering what “captive runtime support” is, then I’ll try to explain… Currently all AIR applications that are deployed on the desktop and in Android require the 3rd-party Adobe AIR runtime. If you are familiar with the process for developing mobile AIR applications for Apple’s iOS devices, then you may already know that these applications don’t require the 3rd-party runtime; they are completely self-contained applications. These AIR applications for iOS already take advantage of the captive runtime. All necessary components of the AIR framework are bundled into a self-contained, compiled distributable application that has no dependence upon other frameworks.

With AIR 3.0, you will have the option to bundle the AIR framework into your applications to eliminate the 3rd-party dependency. However, one thing to keep in mind is that you can only export mac application packages on Macs and Windows EXEs on Windows. You can’t target native installers or bundled runtimes for cross-platform development. You can only have a single app that targets both platforms if you export a .AIR file (which requires the 3rd-party AIR runtime).

Instructions for using the captive runtime:
First, make sure that you extract the AIR runtime SDK from the archive. Instructions for extracting the AIR SDK are located at: http://kb2.adobe.com/cps/495/cpsid_49532.html

Next, add a compiler argument for swf-version=13.

Then use the ADT command line utility to build and package your application. If you run the ADT tool on the command line without passing any arguments, it will show you all of the packaging options.

For the Android captive runtime, you just need to select the target “apk-captive-runtime“, as identified by:

adt -package -target ( apk | apk-debug | apk-emulator | apk-captive-runtime ) ( CONNECT_OPTIONS? | -listen <port>? ) ( -airDownloadURL <url> )? SIGNING_OPTIONS <output-package> ( <app-desc> PLATFORM-SDK-OPTION? FILE-OPTIONS | <input-package> PLATFORM-SDK-OPTION? )

For the desktop captive runtime, you need to select the target “bundle“, as identified by:

adt -package SIGNING_OPTIONS? -target bundle SIGNING_OPTIONS? <output-package> ( <app-desc> FILE-OPTIONS | <input-package> )
  • http://zawa.blogsome.com Zawa

    is it means that android entry level device like samsung galaxy mini could runs android app created by AIR 3 SDK?

    • http://www.tricedesigns.com Andrew

      Good question… I need to check back with the engineering team to see what this means for older devices. I’ll let you know when I hear back from them.

  • http://www.thecodezone.com John Hattan

    Most likely the specs (and baseline processor and OS) won’t change.

    The captive runtimes aren’t AOT compiled like on iOS. The packager just bundles all the runtime AIR libraries into your APK file now. Unzip the resulting APK to see. Your SWF is still packed in there just as before. Just instead of an executable stub that fetches the AIR runtime, it now packs the entire runtime in. So performance shouldn’t change.

  • alex

    Any way to do it with a command line parameter ? I don’t find the syntax…

    Thx!

  • James

    Well, I think an article on how to install and use AIR 3 SDK Beta 2 with Flash Builder 4.5.1 would be helpful before we can test this feature. I can’t find any proper instructions on that anywhere.

  • http://www.csharks.com Juwal bose

    Looking to find out the answer to Zawa’s question. If this enables earlier left out devices to run AIR compiled apps, then we are all starting Android development :)

  • Patrick

    Does I need an Flash Builder update to see this option? I’ve merged the AIR 3.0 SDK into my Flex 4.5.1 SDK but can’t see that option.

  • http://www.tricedesigns.com Andrew

    I heard back from engineering regarding the system requirements, and they have not changed. The captive runtime is only the bundling of AIR components with the distributable application, and as mentioned above, it does not have the exact same pre-compilation optimization steps as the packager for iOS… so there will not be any performance gains. The minimum device requirements for AIR on Android are:

    VGA: Dedicated Cortex A8 (ARMv7) 550MHz App Processor with Neon for A8 only; Hardware Vector FPU
    WVGA: Dedicated Cortex A8 (ARMv7) 800MHz App Processor; Hardware Vector FPU
    Google Androidâ„¢ 2.2 or later
    256MB of RAM

    You can always get the latest system requirements here as well:
    http://www.adobe.com/products/air/systemreqs/

    For the packaging options, you have to use the command line adt packager tool. I will update this post very shortly with updated instructions. You will not see these options in the export wizard in the labs release.

    My apologies for the confusion around the export process.

  • http://www.thecodezone.com John Hattan

    Not sure what to do with Flex, as I do all my stuff with Flash, and I use a command-line script to compile to AIR. In any case, the parameters you are looking for are

    -target apk-captive-runtime

    on Android and

    -target bundle

    for desktop. Note that it builds for whatever platform you’re on, so running -target bundle on Windows makes a Windows bundle, Mac on Mac, etc.

    Also note that -target bundle doesn’t make a single nice single compact executable on Windows. It makes a folder containing your EXE stub, your SWF, and a dozen runtime DLL’s. Pretty ugly if you ask me.

  • http://www.tricedesigns.com Andrew

    Thanks John, I just updated this post with that same info.

  • Pingback: Bundling AIR 3 runtime in AIR desktop applications at Space of Flex/AIR technologies

  • George

    How much file size does it add to the final .apk? Thanks!

    • http://www.tricedesigns.com Andrew

      In my own experiments, I’ve found that it adds a little over 8 MB to the APK package. It’s definitely not huge, but it does increase the overall size. If you are concerned with application file size, it is certainly smaller when using the non-bundled AIR runtime… you just end up with the 3rd party dependency. You’ll end up having both options to consider.

      • http://www.tricedesigns.com Andrew

        Note: These are from my experiments… they are not official metrics.

  • George

    Thanks, good to know. Some people hate to install 3rd party apps (and give 1 star ratings, lol). This is definitely something to try out. Gonna implement it once the beta ends. :)

  • Brendan

    Anyone got apk-captive-runtime working in Flash Develop 4 beta android project?

  • Pingback: leebrimelow.com » Adobe AIR 3 Beta With Captive Runtime

  • Franck Payen

    And will these apps be able to be moved to sd card ? If so, if we could move most of the 8MB to sd card, then, great !

    Else, it might be a failure…

  • Jesse Nicholson

    I have to admit, even though I am a huge critic of flash this is a good move on the part of Adobe. As a former flash/AIR developer I can say this was a necessary move for the platform and I’m glad to see Adobe still listens to the concerns of the people who pay out thousands to use their software.

  • Pingback: Cool Stuff with the Flash Platform - 8/19/2011 | Remote Synthesis

  • Chris

    I second Franck’s question. Can we move this to the SD card ?

  • http://www.magnusmorris11.com Magnus

    Can someone please provide a real world example (ie: the exact line to run in terminal) for android .apk package? i am on a mac and my project is called say MyApp and i want to include all assets in /assets/ folder and here are the paths:

    /MyAppFolder/bin-debug/MyApp.xml
    /MyAppFolder/bin-debug/MyApp.swf
    /MyAppFolder/bin-debug/assets/*

    /Applications/Adobe\ Flash\ Builder\ 4.5/sdks/4.5.1\ /bin/adt

    thanks so much.

  • Magnus

    i got the syntax worked out and now i get:

    error 302: Root content MyApp.swf is missing from package

    the swf is there, any ideas?

  • fr

    Thank you Andrew for this, so i’ll be more precise : do you know how much we will be able to move to sd, so we can estimate the final weight of apps before even testing (like air2.7 = x Ko on SD, x Ko on cellPhone) I didn’t find time to dig at all into 2.7…

  • Magnus

    I still get error 302: Root content MyApp.swf is missing from package” doing:

    -open terminal and cd to adt folder as described above, then:

    -target apk-captive-runtime
    -storetype pkcs12
    -keystore /Users/joeblogs/workspacefolder/projectfolder/bin-debug/mycert.p12
    /Users/joeblogs/workspacefolder/projectfolder/bin-debug/MyApp.apk
    /Users/joeblogs/workspacefolder/projectfolder/bin-debug/MyApp-app.xml
    /Users/joeblogs/workspacefolder/projectfolder/bin-debug/MyApp.swf
    /Users/joeblogs/workspacefolder/projectfolder/bin-debug/assets

    -it will ask for password, put in your certificate password.

    let me know if you have same error and any fix too

    cheers

  • http://www.kzoomarketing.com Ben

    Magnus, I had a similar issue but was able to work it out. It was a combination of getting the syntax right within my terminal as well as my XML file.

    Here is what I put in to the terminal:

    /Applications/Adobe\ Flash\ Builder\ 4.5/sdks/4.5.1/bin/adt -package -target apk-captive-runtime -storetype pkcs12 -keystore /Users/Benjamin/InsuranceHelp/p12/20110824-Certificate.p12 -storepass ********* /Users/Benjamin/Desktop/InsuranceHelp.apk /Users/Benjamin/InsuranceHelp/bin-debug/Main-app.xml /Users/Benjamin/InsuranceHelp/bin-debug/Main.swf

  • http://www.kzoomarketing.com Ben

    Alright, I can get the apk to get packaged and installed! Unfortunately, it won’t run…

    I don’t get an error or anything, just opens, then flashes my screen and goes back to the previous screen.

    Any ideas as to what is going on?

  • http://www.kzoomarketing.com Ben

    Alright, I can get the apk to get packaged and installed! Unfortunately, it won’t run…

    I don’t get an error or anything, just opens, then flashes my screen and goes back to the previous screen.

    Any ideas as to what is going on? I’m using the newest build of the AIR SDK, too.

  • http://www.websibblings.com kanthmx

    doesn’t this a drawback, when you get an AIR runtime update? atleast for the desktop. your bundled Application will continue to use the bundled, no matter you have ‘n’ number of updates?

    • http://www.tricedesigns.com Andrew

      You have the flexibility to chose how your application gets deployed. If you want to use the shared runtime, you can do that and rely on automatic updates. However there are numerous cases where you do not want the runtime to be updated for your application (or if your application is in a secure environment which can’t have AIR installed separately). With the captive runtime, it is only updated if you decide update it. This also means that your application does not run the risk of having its behavior changed by automatic updates.

  • Matt

    1) How do I compile a captive app in Flash CS5.5? Is this possible?

    2) How do move my captive app to SD (not the separate AIR runtime)

    Would love a guide on this.

  • Pingback: Adobe to ship Flash 11 and AIR 3, repositions Flash vs HTML 5 « Tim Anderson’s ITWriting

  • Magnus

    Ben the only way to fix your problem is change the last line of your terminal code:

    from
    /Users/Benjamin/InsuranceHelp/bin-debug/Main.swf
    to
    /Main.swf

    and copy your swf to root directory (/Main.swf). It will work then. In your xml make sure is set to Main.swf.

    This is the only way I can get it to work and the issue is terminal getting back into your bin-debug folder to grab the swf and assets.

    Adobe really need to address this by building it into Flash Builder so it works.

  • Magnus

    The line “In your xml make sure is set to Main.swf.” should say “In your xml make sure content node is set to Main.swf.”

  • Paolo

    Is it possible to create Mac AppStore compliant applications with AIR 3.0 Captive Runtime?

    • http://www.tricedesigns.com Andrew

      I believe that the Mac App Store will be supported, although it is not yet.

  • http://www.thecodezone.com John Hattan

    Yeah, that’s pretty much the whole point of the captive runtime on Mac. Mac App Store guidelines require that apps not rely on any separately-downloaded runtimes, but it’s okay to cram the runtime into the executable itself.

    There are already some Flash-authored games in the App Store (like Machinarium), but they were AFAIK done with the old Flash Projector.

  • Stu

    Noticed a potential severe flaw – unless someone can clarify my thinking?

    Here’s my findings. I created a simple image swap app, using a gesture left and right. All very basic.
    .swf file size = 57kb
    .apk file size = 166kb

    Captive runtime apk file size = a whopping 8.5meg!

    Not done iOS yet, but would the app and wrapper be a similar file size?

    Must have missed a setting somewhere to reduce the file-size surely?

    • http://www.tricedesigns.com Andrew

      Hi Stu, This is not a flaw, it is by design. The AIR runtime gets packaged with the application, removing 3rd party dependencies. This is exactly how the iOS packaging procedure works as well. As a developer, you will have the choice when building android applications. You can either use the 3rd-party AIR runtime (which is a separate install and gives you smaller file size), or you can use the captive runtime to package your application (which has a larger file size, however also removes dependencies and gives you complete control). As I mentioned in the comments above, this adds around 8 Megs to the compiled APK.

  • Stu

    Hey Andrew. Thanks for the clarification. (Sorry, I’ll admit I didn’t read all of the comments before posting)

    But still, 8meg is pretty hefty when considering mobile applications. I cringe at anything over 2meg in the app marketplace and wait until I’m on WiFi because data service provider costs and data restrictions can be so high.

    I totally understand the 3rd party player embedding principles, but I’m hoping Adobe releases a captive version whereby you can tailor the file size and content somehow, depending upon what features you use in Air. As I mentioned earlier 8meg for a 166kb base app suggests there’s a lot of ‘bloat-ware’ that’s never used.

    I guess my main worry is if an app already defaults to being at least 8meg before you’ve even added graphics, sound and code, you’ll be looking at 10meg+ for anything half decent.

    Then multiply that by the number of apps you might make and release. Exasperate this with the potential of any update releases that may follow. 8meg can suddenly become a whole lot more…

    The flip side is, yes, I can chose to publish my app without the Air player and rely on the client having said player installed, but then, you’re targeting a completely different kind of market demographic.

    To me, it doesn’t really equate as a mobile apps, and I’m worried that others will see it this way when I eventually start publishing to the market places.

  • http://www.tricedesigns.com Andrew

    Hi Stu, no worries about the previous comments… I don’t expect everyone to read all of them. :)

    I’ll be sure to pass this feedback back to engineering. Adobe is committed to delivering tools that will enable rich & powerful applications on all platforms, and we aim to provide the best tools and experience possible. This release is a pretty big step forward, and I’m sure that things will get even better in future releases.

  • Magnus

    Stu it is worth noting the top-selling app in the android store is 25MB.

  • Andrew

    How do we do this if we’re using Flash CS5? There’s no info anywhere :[

    • http://www.tricedesigns.com Andrew

      You can develop using the updated AIR SDK, however, you will need to use the command line to export a binary which includes the captive runtime.

  • Andreas

    Same question here – how do I compile a captive app in Flash CS5.5? Is this possible or do I need to switch to command line?

    • http://www.tricedesigns.com Andrew

      Yes, you will have to use the command line until the updated Flash IDE tooling is available.

  • Magnus

    Now that we have official air3 and fp11 do we still need to put -swf-version=13 in properties?

    • http://www.tricedesigns.com Andrew

      I have not heard otherwise. I would keep it.

  • Phil

    If using captive runtime to distribute by CD-ROM for Windows/Mac, will we fall foul of any legal requirement to only bundle the latest version of AIR at any given time (e.g. CD re-duplication a year or two after first release)? I recall from past experience that Adobe Reader CD distribution requires something like that. In our education market a CD product lifetime can be a few years and we just want to re-duplicate from the original image periodically.

  • Phil

    Thanks. I don’t quite understand something still. Does choosing the captive runtime command line option to bundle the framework with our apps mean that we have to sign up with Adobe for runtime distribution? The FAQ and licence agreement seem to be discussing the distribution of the framework as a separate file (not bundled in the package or exe) so users can install ordinary .AIR files without downloading the framework. I didn’t think it referred to the new captive runtime feature.

    • http://www.tricedesigns.com Andrew

      Actually, It looks like the FAQ has not been updated for captive runtime. I do not believe that you would have to sign up for runtime distribution, since you are not distributing the actual runtime for others to consume. However, let me look into this further. Thanks, Andy

  • http://www.grandinteractive.com William Grand

    Here is an example on how to create a .app file on a Mac. First, you have to create a .AIRI file (an unsigned AIR file), then do the following in Terminal:

    adt -package -storetype pkcs12 -keystore SelfSignedCertificate.p12 -storepass CertificatePassword -target bundle MyApp.app ./descriptor-app.xml ./MyApp.airi ./xml Protocols_Large.swf [RESOURCES, e.g. myXmlfile.xml, MyImage.png]

  • http://www.grandinteractive.com William Grand

    Anyone know how to sign a .AIRI file with an Apple certificate? The end goal is to get an AIR app into the Mac App Store

  • http://zehfernando.com zeh

    Great addition and it’s working well. Thanks.

    A question, though; when I create a captive runtime, adt automatically add two “uses-permission” requirements to my manifest: “android.permission.INTERNET” and “android.permission.BROADCAST_STICKY”.

    Is there any way to disable that? I don’t see why those should be needed since I’m not using them.

  • Pingback: Zeh Fernando » Blog Archive » A mobile AIR application post-mortem

  • Greg

    Hi Andrew,

    With captive runtime can my AIR application run directly off a USB drive? Zero install… just launch and run?

    Thanks,

    Greg

  • http://vnfx.com Trung Tran

    who test on Android 2.2?
    first i package app using adt -package apk-captive-runtime, it’s ok. but when i install on my devices using Android 2.2 it’s said Failure [INSTALL_FAILED_INVALID_APK](use apk-emulator is ok).
    Work on Android 2.3.3 (tested).
    Don’t work on Android 2.2 .
    help me pls Y_Y

  • Razvan Deac

    Hi,
    I’m having a lot of problems using Captive Runtime on the following scenario : Captive Runtime + HTMLLoader + user with no privileges (usual scenarion for school computers).
    Thanks,
    Razvan

    • http://www.tricedesigns.com Andrew

      Hi Razvan,
      What kind of problems are you encountering? That is a very general description, which could be just about anything. It could be something specific to your application & permissions, could be something blocked by your school’s network, or a bug in the application.

  • Razvan Deac

    Hi Andrew,
    The app has a html control wich loads some html (from an epub).It runs from removable disk only all the data it’s stored on the disk because the students will have no permissions at all on local hard -drive. The app starts and in short time it stops working .After a while windows asks to send errorn,in details of the error Webkit.dll is shown. If i remove the html control and test under the same scenarion the app will work.
    Thank you for your interest,
    Razvan

    • http://www.tricedesigns.com Andrew

      Hi Razvan,
      That definitely sounds like a bug in the runtime. Can you file a bug at https://bugbase.adobe.com, and provide the description that you have given me, as well as the details shown in the error from webkit.dll? I do not know of a workaround for this issue.

      Thanks,
      Andrew Trice

  • Razvan Deac

    Thank you Andrew for you reesponse,
    I will submit the bug these days becuse from my opinion this is core functionality of what Captive Runtime should be able to do,because the scenarion is an usual one for enterprise / school computers. Unfortunetely due to this problem we had to drop the dproject at least for now,we were willing to move further in developement for this app :(.
    Have a nice day,
    Razvan

  • http://flexblog.teerasej.com/en Teerasej

    Thank you for sharing overview on this technology. But I wonder could we publish AIR app with captive runtime to install on Linux?

    I know Adobe suspended AIR runtime development on Linux since 2.6. But this may be the game changer and I’m quite sure the other need to know this answer too.

    • http://www.tricedesigns.com Andrew

      The system requirements for captive runtime are identical to the shared runtime. Linux is not supported at this time.

  • Damian

    Hi Andrew,
    Great article! I’ve recently started using AIR for Android development & deployed my first app a couple of days ago. I wanted to ask two questions:
    1. I’m using Flash Pro in CS 5.5. Do I have do the step of adding a “compiler argument for swf-version=13″? I couldn’t find ‘Project Properties’ anywhere.
    2. I recently deployed an app to my Android tablet (Motorola Xoom) using AIR 2.6 with Flash Pro. But I had to also get AIR from the Android Market for it to work. Now I’ve updated to AIR 3.1. So I shouldn’t need to download AIR separately onto my tablet to get my AIR apps working. The problem is that I want to test to make sure I did everything right. So, I want to uninstall AIR from my tablet, deploy my new app to it and see if it works fine. But I can’t find the AIR files on my tablet anywhere. Do you know how I can delete them for testing?
    Thanks for your consideration!
    Damian

    • http://www.tricedesigns.com Andrew

      1) I don’t believe you have to use the compiler argument, however you will have to package the AIR application using the ADT packaging tool via command line, which is a part of the AIR runtime. You can get from here: http://www.adobe.com/special/products/air/sdk/ I personally use Flash Builder, and haven’t tried exporting captive runtime AIR apps from Flash Pro myself.
      2) Go to settings->manage applications”, and “Adobe AIR” will be listed under “downloaded”. You should be able to uninstall from there… (at least, that is where it is located on my Samsung Galaxy Tab).

  • Damian

    Thanks Andrew. Very helpful! I’ll keep trying!

  • G. Sliv

    I can’t get the captive runtime to work with nativeApplication.startAtLogin.

    http://www.adobe.com/devnet/air/articles/air3-install-and-deployment-options.html

    writes this can be done by adding the appropriate settings to your custom-built installer.”, but does not mention WHAT settings.

    Very frustating.

  • Neil Munro

    Using FlashDevelop (based on Mobile sample), added the swf..=13, builds apk fine. On install, asks for correct permissions but after progress bar it just says ‘Application not installed’. Testing on Android 2.2 epad style MID (wondermedia). Any suggestions?
    Thanks.

    • http://www.tricedesigns.com Andrew

      Hi Neil, Do you get any error messages at all? I have not seen this myself. Have you been able to deploy the application using the shared runtime? Perhaps try the Adobe Forums?http://forums.adobe.com/search.jspa

  • Neil Munro

    Hi Andrew, this epad does not have full Android Market access and the Air runtime does not appear, even though it is 2.2. The epad itself meets the Adobe min spec, it just isn’t approved by Google.

    I tried indirectly installing the air apk and it failed as well, without any error message… I thought that the captive option was the solution! No, there are no other displayed error messages but I’ll see if I can find/enable some sort of logging.

    Thanks.

  • G. Sliv

    @Andrew The problem is, I want to toggle “run on start up” after installation (via a settings screen in the application)

    • http://www.tricedesigns.com Andrew

      G Silv, I’ll have to ask engineering about this, and the impact of captive runtime. Unfortunately, Adobe is closed for the winter holidays, and won’t be open again until 1/2/2012, so I won’t have an immediate answer.

  • Neil Munro

    Displayed logging during install using “adb logcat”. This showed info that I found out basically means this epad’s processor is not in fact the minimum required by Air, so it’s a non-starter. It’s a shame as I’m not doing anything really ‘flashy’ (essentially its a wrapper for StageWebView) so the app would probably run OK. Ah well, better try PhoneGap!

    • http://www.tricedesigns.com Andrew

      Neil, Have you tried PhoneGap? http://phonegap.com It allows you to build natively installed apps using HTML/JS (essentially a web view with API to device system). The hardware specs are lower than AIR, and would probably work for you.

  • Damian

    Hi Andrew,
    Just wanted to report back to say I was finally able to package AIR along with my other files into an Android .apk file. I took a while but once I knew what to do, it was straightforward. Now I can create my swf in Flash Pro 5.5 & package everything (including AIR) into an .apk file via the command line. I found the following forum thread EXTREMELY helpful: http://forums.adobe.com/thread/909784
    Thanks for your help along the way!

    One question: My impression is that FB gets various features ahead of Flash Pro – eg. the ability to include the captive runtime environment w/o having to go to the command line. Is FB generally considered to be the Flash IDE of choice?
    Just curious.
    Damian.

  • http://www.grandinteractive.com William Grand

    I’m still wondering if anyone has managed to put an AIR app into the Mac App Store. Anyone?

    • http://www.tricedesigns.com Andrew

      I think there are workarounds that may allow it, but Apple is implementing new security sandbox rules that cause issues… I’m asking around internally for more detail.

  • http://none pic.micro23

    This is really good good article and a good addtion to FB. I wish the captive runtime for android would do native compilation as it’s done for iOS so we could target old and not so old devices.
    The new cheap tablets released in India and China use ARM11 (<$80USD) because of the prices.
    So the only option now, it's to invest in development based on java or monodroid (c#) and be able to target target those devices. Or wait few years when the market has more A8/A9/A15 arm processors.

    What about the windows phone 7?

    I have invested time developing in FB but now I don't know what I should do for my next project if i want to consider WP or the low end devices. I really like FB but I dont see how I can solve my two problems (lower end devices and WP7).

  • dv

    Hi,
    is there any workaround for this?:
    “..However, one thing to keep in mind is that you can only export mac application packages on Macs and Windows EXEs on Windows..”

    I need to generate Mac app from the Windows environment.

    • http://www.tricedesigns.com Andrew

      You can always try running the OS in a virtual machine. Otherwise, you are limited that you can only create exe on windows and .app on mac.

  • Neil Munro

    I agree with pic.micro23 – native code generation for Android would be very attractive for low end devices. I much prefer developing in Flex/AS3 than Java and it would allow cross platform (iOS/Android) + good performance.

    Andrew, I did try phonegap and although it is very good for some things, I found some serious hassles with HTML5, like support and a bizarre situation where canvas touchmove events are ignored until touchend! In other words, nothing appears on a canvas until you lift your finger. Apparently this is an oddity of Android 2.2 but low end devices often have this, so it is useless so it looks like I am going to have to use native Java for graphics.

  • Neil Munro

    OK, that should have said ‘HTML5, like video support’ – I’m guessing you are removing angle brackets rather than escaping them ;-)

  • http://flexdomino.blogspot.com Matthias Wille

    Has the captive-runtime option be included in the Flash Builder 4.6 UI under packaging and or compiler options?

    I do not see myself starting to build batch files for all me projects to use this option. Unless it is in the UI its useless.

    • http://www.tricedesigns.com Andrew

      Yes, it is in the “export release build” dialog.

  • http://flexdomino.blogspot.com Matthias Wille

    Not for me :-(

    I have FB 4.5 installed, but no such option is available.

    In matter of fact I found this posting showing a screen shot, that differs from what I see:

    http://houseofbilz.com/archives/2011/10/11/captive-runtime-packaging-in-air-3-0/

  • http://flexdomino.blogspot.com Matthias Wille

    Sorry, I meant FB 4.6

    • http://www.tricedesigns.com Andrew

      It is there in 4.6… not sure why you wouldn’t see it unless you are on an earlier version. Also make sure you are using the 4.6 SDK, not an earlier one.

    • http://www.tricedesigns.com Andrew

      In Flash Builder 4.6, you should see the following in the “export release build” wizard:
      For AIR mobile: http://screencast.com/t/dORBkja5XB
      For AIR desktop: http://screencast.com/t/lqIWikC3

  • http://www.flexdomino.net Matthias Wille

    Adobe Flash Builder 4.6 – Version: 4.6.0.328916

    Flex 4.6.0 (build 23201)

    As far as I can tell these are the latest releases.

    • http://www.tricedesigns.com Andrew

      I am pretty sure that is an older build. Did you get it build from Adobe Labs? The latest release bulid number is higher… I don’t know the exact build number, but I know it is at least build 325268. Try getting the latest from http://www.adobe.com/products/flash-builder.html

  • http://www.flexdomino.net Matthias Wille

    Just doing that. The problem with the Adobe FB download is that you just end up on the Trial download page and you never can tell what version you download. You know when you install. Maybe I’m missing something or I’m just too damn stupid!?

  • http://www.flexdomino.net Matthias Wille

    OK, after reinstalling everything I now finally see the captive runtime option.

  • http://www.pragmasoft.dk Ole Mansfeld

    I was wondering if it would be possible to include several games compiled with air for mobile in one objective c written app? Anyone got any idea? Thanks!

    • http://www.tricedesigns.com Andrew

      No, each IPA file is a separate application. You could have one application that contains several games, but it be limited to a single app with a single icon on the home screen, and it would still only be considered as a single app.

  • RandomGuy

    Not very clear for beginners. OK, i have an SWF, how do i turn it into working Android APK with embeded AIR?

  • RandomGuy

    I managed to embed Adobe AIR runtime to my .apk on first try. Everything is working perfectly. Thanks Andrew!

  • http://www.matmi.com James

    After spending the last 2 weeks researching APK deployment with captive runtime and native extension support for both iOS and Android I’ve come to one conclusion…..it really is NOT straight forward.

    Due to a number of issues (speed of development of new technologies, Apple having gripes with Adobe and Adobe being slow to update and provide usable IDE’s – rather than asking us to hack and command line ourselves out of situations) the whole process seems very convoluted. It doesn’t help that the process of exporting has changed since 2011 and with multiple versions of FB and Flash CS flying around the whole process just seems like a mess.

    I think Adobe need to give us a run down on what we can expect Flash CS6 to provide in terms of IDE, and whether or not the FB4.6 process is to change in the meantime or not. Apple and Adobe need to deal with their issues quickly and Google, Windows, Apple and Adobe need to figure out a more common structure for all the Air developers out there.

    It’s a real turning point for Flash/Air and if they mess up this step they’ll see a huge drop off of developers. We’ve been using Flash for over 10 years and now we’re focusing on mobile dev we’re on the verge of ditching Flash unless the whole process of Air app dev for mobile (including native extensions) becomes more straightforward and reliable

  • http://www.matmi.com James

    Thanks for that link Andrew, the road map was very informative.
    I finally managed to get AIR3.1 running in Flash Builder, with native extensions running. Needless to say I’ll be ditching Flash Professional for any compiling and coding and stick with Flash Builder from here on in.

  • Phil

    I want to place a config.xml file next to my captive runtime app on Mac (I’ll want to do the same for PC too) and read it from the app.
    This poster has explained the issue …
    http://stackoverflow.com/questions/9447945/how-to-an-open-an-xml-file-found-in-the-same-folder-as-a-captive-air-application

    How can we get the path?

  • Phil

    OK – I’ve found a way. Here’s the whole bit of code ….

    var f:File = File.applicationDirectory;
    var s:String = f.nativePath + “../../../../”;
    f = f.resolvePath(s + “/” + “config.xml”);
    var fs:FileStream = new FileStream();
    fs.open(f, FileMode.READ);
    var configData:XML = XML(fs.readUTFBytes(fs.bytesAvailable));
    fs.close();

    Feels a bit untidy though. It would be nice if File.applicationDirectory could adapt in the captive runtime environment.

  • Vshare

    Hi Andrew,

    Thank you so much for the explanation

    I am running into an issue with respect to admin privilege

    I have packaged AIR application & AIR Runtime using captive runtime and then I used advance installer to create a .msi package. After installing the MSI when I started my application it started installing AIR runtime and to do that it asked for Admin privilege. Am I doing something wrong here. Do I need distribution license to install AIR runtime without Admin privilege?

  • ThaStyle

    Here is a flashdevelop template
    http://dl.dropbox.com/u/67961981/212%20aircapiva%20deskap%20wirh%20mobile%20comps.rar

    is it even possible to embed dll files like i can when i make an installer ?

    anyways pretty cool stuff, java on xp sp1 and it will run (dotnet to build)

  • Harsh

    Hi Andrew…thanks man..have been running all over the net for a solution for night long..!!
    I added the compiler argument and my apk got compiled and now runs like a charm…
    Wonder why adobe people can’t mention it in BOLD somewhere in the DOCS..!

  • Prashant

    Hi Andrew,
    I am trying to sign native DMG installer on MAC using AIR package, I have use following command on MAC

    ./adt -package -storetype pkcs12 -keystore auth.pfx -target bundle myApp.dmg myApp.air

    But I am getting error as “Found signing arguments and an AIR file as input. AIR files are already signed”
    What it mean?
    Can you please suggest me any solution for this.

    Thanks in advanced.

  • Phil

    Hi Andrew,

    If I’m distributing a captive runtime application on CD for Windows and Mac, where does the difference between an authority provided certificate and self sign become apparent. In traditional AIR installers it’s obvious from the alerts to the user during installation but with Captive Runtime does it matter?

    Thanks.

  • Phil

    Hello again. I’m still trying to figure out if I need to buy an Adobe AIR code signing certificate or if I can just self sign the AIR app for Captive Runtime. With traditional AIR files, the user would be shown the certificate details during installation. But that’s not the case with Captive Runtime right so I’m thinking self-sign is fine even for commercial software. That’s question 1. Second question is to do with Gatekeeper on Mac 10.8 … for that I think I can still self sign but also have to do the extra bits of signing with apple id and certificate (and even then users can choose to override if they want). So my ultimate question is do I need to buy a Adobe AIR digital certificate from one of the authorities if I’m using Captive Runtime?

    Thanks.

  • Andrew

    I don’t know if anyone’s said it but I’ll say it anyways; Flashdevelop Does all the signing and captive runtime packaging for you. Wasn’t available when this Blog post was published.

  • http://www.web-attitude.fr Thomas Parquier

    Hello,

    Is there any mean to package the whole folder into one executable file on windows ?

    TIA,
    Thomas

    • http://www.tricedesigns.com Andrew

      Yes, when using the captive runtime, everything gets packaged into a single .msi installer.

  • Raval JAY

    hi, Andrew
    I am developing a game for Android platform with adobe Flash builder 4.6. When I build Final Application with captive run time, it generates 10MB .apk file. Is there any way to reduce that size? Can it be possible that unnecessary libraries are excluded from that APK file? Since I got review that I should make light weight Application instead.
    Thanks in advance.:-)

    • http://www.tricedesigns.com Andrew

      Currently, there is no way to make the file smaller. It includes the entire AIR runtime. Options for reducing dependencies, or exclusion on non-necessary dependencies are being explored, but this is your only option for now.

  • ARD

    Hi Andrew,

    The adt command to bundle AIR runtime with the AIR application hangs just after creating the .tmp folder. I do not see the package being created.
    this is the command
    adt.bat -package -storetype pkcs12 -keystore certificate.p12 -target bundle myapp.exe myapp-app.xml -C . myapp.swf

    I have also tried
    adt.bat -package -storetype pkcs12 -keystore certificate.p12 storepass pasword -target bundle myapp myapp-app.xml -C . myapp.swf

    I am using
    AIR SDK – 3.1 and flex sdk 4.6.0.23201
    JDK – 1.6

    Any pointers would help, If there is a way to debug the adt command logs or trace which could help look into further would help. At this moment I am just lost seems I have hit the dead end.

  • Arman Mohammadi

    hi Andrew

    i use FlashCs6 and Air 3.2 for android in Publish setting , when i use embed Air runtime the size of Apk increase about 8 MB !! and it`s too bad for me special for users that have slow connection or when they want to bluetooth it !!

    is there any chance to reduce size of Air runtime ?? or any third party software suggest for export and swf to apk with lower size and not need big size runtime !!

    thanks