What is the users Adobe AIR version and why is it important?
Until now it didn't really mater the version of our AIR that we are building in nor was the version that the use had but as you start building real world applications its going to become more and more important knowing the run time that the user has to enable specific capabilities that where only introduced in later air versions. In the next step of our training we will dig deeper into the world of understanding the device capabilities.
Video Transcript
00:00Alright, so in our first course, in our first segment of our courses that showed you how
00:04to publish to Air and publish to iOS and to desktop and so on and so forth, we talked
00:09also about basically that you need to define your version of Air that you're running on.
00:14Currently, we're running on Air 3.6 with the version that we're showing you in this
00:18demo in this video.
00:20With that said, we also said that you have two capabilities in your publishing setting,
00:24mainly when you're publishing for Android.
00:26And in those publishing settings, you basically could figure out and decide if you want to run
00:33the application while asking from the user to get the Air runtime or in the Google Play
00:40platform or in the Amazon AppSphere app space, or if we want to embed the Air runtime.
00:46We said it's called Captivate when we embed the Air runtime.
00:50When we embed their Air runtime, we actually make sure that the user could watch our application
00:55without any problem because they don't have to install any extra feature, but it automatically
00:59grows our application dramatically in size.
01:02Now, if we wanted to just run our application without embedding the Adobe Air, our user
01:08might have a more up-to-date Air version or an older one, because as soon as the Air
01:12is running on their end, they might not have the capabilities that were introduced
01:17in different variations of the Air platform.
01:19So one of the things that you really have to know when you're working with a specific,
01:24when you're working without embedding the Air runtime is to know what is the capabilities
01:28of that user basically by asking what is the Air version they're running.
01:33So as new features are added into Air, some of them will only work if the user has the
01:37most up-to-date Air application, which they don't necessarily have.
01:41So let's see how do we check that, which is very simple.
01:45So I'm going to go into my ActionScript panel and I've deleted all the ActionScript
01:48so we could start anew.
01:50And I want to introduce you to two classes, two static classes, where we could get a little
01:56bit more information, more insight about our application.
01:59So the first one is going to be the Capability class, so I'm going to import it, and we're
02:03going to import it out of the FlashSystem.Capabilities, and that's where our class lies.
02:09The second class that we're going to import is we're going to import the Flash.Native,
02:14well desktop actually, and it's called Native Application.
02:20While the Capabilities class doesn't talk about the operating system that you're working
02:25on really, it stores basically global information that relate to capabilities.
02:29We're going to look more deeply into the Capability class in the next video.
02:34While the Native Application holds more information about the Native Application itself, which
02:38is specifically Air-related.
02:42So I'm going to look at, first of all, I want to show you basically the version
02:45of Flash that we're running on and what operating system we're working on.
02:49To get that, I'm going to fetch that information using a Trace command and asking the Capabilities
02:55library, let me type it correctly, Capabilities, for its version.
03:01And when we fetch the version, we'll get the operating system as an acronym of three letters,
03:05and then the specific version of Flash that's running in that configuration.
03:10The next Trace that we want to do, and we'll do them both together, is we're going
03:13to trace out from the Native Application the actual version, the runtime version.
03:19To do that, we're going to ask for that Native Application.
03:22The current instance, it's a singleton, if you know programming terminologies.
03:27If not, just make sure you copy and paste the information the way I'm putting it, or grab
03:31our source files from zero2geek.com.
03:33All right, and the next property is we're going to go to runtime version.
03:38So that's basically, you don't have to worry too much about the details because you could
03:41get your runtime version by just typing this.
03:43You don't have to understand why or how.
03:45And the same thing is for our version where we'll get our operating system and the version
03:50of Flash that's running.
03:51Now, if I run this locally, so I'm going to click on that Command-Enter to run it locally,
03:56or Control-Enter if you're on a PC, and we're not going to worry about the application.
04:01We want to look really at this little example that we have here.
04:04So first of all, we see that we're running on a Mac, which is true, and our Flash version
04:08is 11.6.62 and so on.
04:12So we're running Flash Player 11.6, a.k.a. if there's a new feature added in Flash Player
04:1712, but the user doesn't have Flash Player 12, we could then basically ask based on the
04:22version of the user's Flash if we could add that extra capability or not.
04:27Same is true with Air.
04:28While in Air, we get a more specific input of the output itself, where we could see
04:33it's 3.6.0.60.90, which basically means that we're publishing for Air Android 3.6,
04:39which is basically what we have also running on our system.
04:42Now, the next step that we want to do is I want to show you what would happen if we
04:45publish this application, but send it to my Android device, which I just installed
04:50Air on it, but the Air version out there is already newer.
04:53So notice and just remember these numbers.
04:56I'm just going to copy it right here, and I'm just going to show it just for
04:58the sake of our example right here, I'm going to save it right there.
05:03And I'm going to run the Android, I'm going to run the debugger by clicking on
05:06the command shift and return or control shift enter.
05:11Once I do that, it's going to publish out into my device,
05:14same as we did in the window so far.
05:16But this time around, the information that we're going to be getting is going
05:19to be from the Android device directly, where it's going to tell us what version
05:23of that Flash runtime is running on its end, which is 11.8, all right?
05:29And our Android Air time, our Android Air application is 3.8,
05:34so it's a much later version.
05:36So if there were extra features, we could actually build up our applications
05:39with the core capabilities of every Air application, and then add extra
05:44capabilities depending on the version that the user has using if statements
05:48and checking basically the Adobe documentation and
05:51checking what features were added later on.
05:54Now all the features that we have talked about so
05:56far are available on any Air application.
05:59As we talk about specific versions of specific classes or
06:03specific implementations that are device specific or version specific,
06:07we will mention it in the video as well.
06:09So you don't have to worry about it too much, but you do want to make sure
06:12that you are aware of this because it's going to become very handy as you
06:15start developing deeper and deeper into the world of Air applications on iOS,
06:21Android, desktop, and so forth, all right?
06:24So.
