Air2 beta2, getting started

Its a long time since Adoeb released AIR2 BETA2,but some how I could not got time to play with it till now. Well, here it goes.
First of all there are a couple of ways, one can get started. One is, if you are still in Flex4 SDK (which comes with the new Flash builder), get the new AIR SDK and over-right the old one with the new AIR part of the SDK. That will make you get started. Else, if you always try to be on the challenging and exciting side of things, then I would suggest, get the last nightly build from the opensource.adobe.com. For this test example,I have taken the Build-4.1.0.16021 ( Today’s build, can you feel the edge 😉 ). That way, you do not have to over write anything. Well, it does not seem to work directly out of the box as expected. Still we need to copy-paste the AIR2Beta2 SDK files. Nothing to worry, lets get on to the business of setting up the environment. Once you have your Flex4 sdk ready in one folder and AIR2Beta2 SDK in another folder, its just a matter of copy-paste (over-writing the files). Just copy all the files from the Air2Beta2 folders into FlexSDK folder and over write all the files. Thats all we need now.
Well, thats all set for developing your AIR2 applications, as I am not going in detail of setting the environment variables and path in windows systems. If you think, you need help in setting those, leave me a comment here, and I would be more than happy to help you out in that.
Now you need to get the AIR2 BETA2 Runtime, to test and run your AIR2 applications.

There are some minor but must changes to be made to our code, in order to take advantage of the new SDK and Runtime.
  • If you are altogether new to Flex 4 (Gumbo) SDK, the first change would be the namespace at the begining of the MXML file.
<s:WindowedApplication xmlns:fx=”http://ns.adobe.com/mxml/2009&#8243;
xmlns:s=”library://ns.adobe.com/flex/spark”
xmlns:mx=”library://ns.adobe.com/flex/mx”>
All other changes are with the application descriptor file . Lets go one by one here.
  • Here again, there is a change to the namespace. If you are using AIR2 beta 2, the namespace will look as below
Make sure it ends with “/2.0beta2
  • Well, AIR2 introduces Native Process access. To get the access to native process of operating system, AIR application must be bundled with a native installer, that means it must be a DMG if its MAC else it would be an EXE for windows. To bundle and take advantage of Native Process, one has to put the below optional tag inside the application descriptor file.
<supportedProfiles>extendedDesktop</supportedProfiles>
This does not mean, you are bound to one profile. One can add multiple profiles inside the “supportedProfiles” tag. For example
<supportedProfiles>extendedDesktop desktop</supportedProfiles>
The important thing here is if “supprtedProfile” is set to “extendedDesktop” and the application is tied to be packaged to an AIR file, it simply will not work. It has to be packaged as a native application,which is the next point of discussion. This makes a nice point to the developer as of accidentally compiling to an AIR file when one needed to compile it to EXE or DMG.
-target native myApp.exe
Thats all if you want to get started with AIR2 and all its new capabilities.
NOTE: After writing of the blogpost, I realised that Adobe has released AIR RC today only. I will keep you updated if there is any change on the RC as to BETA2.
Happy Flashing 🙂
Advertisements

Author: saumya

designer / developer / maker / educator @saumya

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s