Captive Runtime packaging in Air 3.0

October 11th, 2011

When I talk with people about the Flex framework, many think of it as a Flash library. They often refer to Flex as a web framework that runs in a plug-in. To me, however, Flex is an application framework. To be honest, Flex in the browser doesn’t excite me. I am much more interested in using Flex on the desktop or on mobile devices.

Some History

Until recently, Flex has been criticized for requiring a separate runtime install. The criticism is valid – users were often confused by this and found the need to upgrade something other than the app they wanted to install. The user experience became one where the user was left wondering, “what just happened?”

In one case, my customer required that nothing be allowed installed on the users’ machine (network access was not available either). This meant no Air runtime and no app. We had a workaround which included an app embedded inside of a PDF but that left the user feeling like they were watching Inception (an app within an app…).

Although this was the case in OSX, Windows and Android, it was not the case in iOS (iPhone and iPad). Apple doesn’t allow third-party runtimes on their devices so Adobe created a native compiler and packager that bundles the Air libraries directly into the app.

Captive Runtime

In Air 3.0, however, the requirement for a separate Air runtime has been lifted. With the “Captive Runtime” feature, developers can bundle the native Air libraries with the app. When apps are bundled this way, they can be deployed any way you want. They won’t require an installation of Air OR the application itself (on the desktop; mobile apps still need to be installed but can be without the separate runtime). This doesn’t mean you are restricted from installing your app but it means that it is no longer required. In addition to iOS, Captive Runtime will work in Android, OSX and Windows.

Let’s see how easy it is to use. I will create a “Hello World” app for illustrative purposes but significantly more complicated applications work just as easily.

Flash Builder 4.6 has integration built-in integration for captive runtime.  When you “Export Release Build” from Flash Builder, you simply create a “Signed application with AIR runtime bundled”.

Everything else is the same. You add a signed certificate to the app as you normally would and any other packaging settings.  When you are complete, you will get a native application that is ready to execute but doesn’t require Air to be installed.

This app can be copied to a thumb drive, shared from network storage or embedded into an installer. It is an application just like any other.

Note that this does bloat the size of your application. This may or may not be an issue for you depending on your audience and deployment mechanism. You can always package your app as a traditional Air app if you prefer.

The Windows story for building your app is exactly the same as the OSX side. The only difference is that the app is packaged as an EXE with the Air support alongside it.

The story for Android is similar. You have a different dialog for packaging, but the idea is the same. The APK that is produced will have Air bundled inside.

Of course, you don’t need to use Flash Builder to package your app. You can do it from the SDK and the command line. Instead of repeating what you can already find out in other places, I will just refer you to Andrew Trice’s blog for more info on that.

 

If you would like to get a sneak peek of Flash Builder 4.6, you can apply for the Flex and Flash Builder pre-release.

 

Slides and Presentation for “Mobile Air” Presentation

May 6th, 2011

This morning, I presented at StirTrek 2011.  Here are my demos and presentation: Presentation Code Demos ScoreKeeper (Shared screens) Demo

Introducing Jasmine-Flex

April 5th, 2011

I have been developing software using Test Driven Development (TDD) for over three years now.  I usually use traditional xUnit style testing frameworks (NUnit, JUnit, jsUnit, FlexUnit, cppUnit, etc) because they are the most accessible frameworks out there. In reality, though, my TDD style has evolved into more of a Behavior Driven Development (BDD) style Read More...

Presentation Model and Multiple Screens (Flex)

March 24th, 2011

I put up another post to RiaRockstars.com recently. This time it is about the Presentation Model pattern and how it will aid you in developing for multiple screens (Phone, Tablet, Web, Desktop, etc). It is part 1 of 2 in a series I am co-authoring with Charlie Sears.

Mobile Smackdown — Flex Edition

February 24th, 2011

I posted a screencast of building a Flex Mobile application in 12 minutes.  It is a clone of the app they built in the Mobile Smackdown at CodeMash this year. Check it out!

RIA Rockstars

February 8th, 2011

Just a quick note.  I will be popping over to RIA Rockstars every once in a while to write content for them.  Essentially, they took over the hole that was left when Adobe and O'Reilly shut down Inside RIA last month.  Many of the same authors moved during that change, so the same quality of content should be expected of RIA Rockstars Read More...

Cross-Training in Silverlight & Flex–Data Binding

January 24th, 2011

More Cross-Training in SIlverlight and Flex One of the most powerful and compelling features of RIA frameworks like Silverlight and Flex is data binding.  Data binding is where you declaratively state that a property in the view is “bound” to data in your model (or presentation behavior layer) Read More...

3-Day Flex Jam with James Ward

January 12th, 2011

If you want to learn Flex or simply want to hone your skills, you need to know about this 3-day Flex Jam. SRT Solutions of Ann Arbor, MI is hosting a Flex Jam on Februrary 15-17 with Adobe evangelist James Ward.  The format is simple: Come to the jam with a problem you want to work on.  If you don’t have a project, no problem Read More...

CodeMash Slides and Demos

January 11th, 2011

  This Friday, I will be presenting at CodeMash for the second year in a row.  This year, my topic is Everything You Always Wanted to Know About Flex * But Were Afraid to Ask.  It is really just a presentation form of my current series – Cross-Training in Silverlight and Flex. As a good speaker-citizen, I wanted to post my slides and demo Read More...

Introducing… ActionLinq

January 4th, 2011

I am excited to release a pet project of mine that I have been developing for a few months.  ActionLinq is a complete LINQ-to-Objects implementation for ActionScript 3.0.  Including the same deferred execution behavior as LINQ, ActionLinq is a functional query library designed to process and manipulate data in ActionScript 3 Read More...