Some Tips and Tricks for Working with the UCompOS Framework

As I’ve experimented with some various aspects of the UCompOS framework, I have picked up on a couple of subtle nuances that I thought I’d share.

First, if you haven’t yet switched to the Flash Builder 4 Beta from Flex Builder 3, doing so is probably a good idea.  One key reason (beyond enhanced functionality) is that I have noticed a significant reduction in the sizes of exported Flash Builder 4 swf files.  For example, one artifact I had created in Flex Builder 3 was about 300 k when I exported it, but this was reduced to about 70 k once I ported it to Flash Builder.  I was surprised at the huge difference.

Speaking of Artifacts, after talking with Edward Mansouri at some length about some of the file size issues I mentioned above, and his recommendation is to use Flash CS 4 or 5 (if you’re lucky enough to be in the private beta program) for artifact development wherever possible.  Flash can get your file sizes down to roughly a tenth of what I can get them down to in Flash Builder, which is a big deal if you have a lot of artifacts in your implementation.

I want to move on a little bit and talk about developing applications using the AIR 2.0 SDK, which is the only way to take advantage of some of the AIR functionality in the UcompOS framework.  The AIR 2.0 SDK and runtime can both be downloaded from http://labs.adobe.com/downloads/air2.html (you will need both).  Once you have downloaded it, go ahead and install the runtime (which installs automatically).  However, you will need to need to do some tweaking to Flash Builder in order to install the SDK properly (I will only cover Flash Builder in this blog post).  What you need to do is find the “sdks” folder in your Flash Builder folder and open it.  It should look something like this:

pic1

What you are going to want to do next is make a copy of the 4.0.0 folder.  In my case I copied it and named it “4.0.0 AIR 2.0″

pic2

This will be the folder where we copy the files from the AIR 2.0 SDK into.  Simply open the ZIP file containing the AIR 2.0 SDK and copy and paste the files into the 4.0.0 AIR 2.0 folder.  If you are prompted, be sure to overlay any old files with the new ones from the ZIP file, or you will run into problems.

pic3

Now, you will need to configure Flash Builder to use the new SDK for applications.  To do this, open up Flash Builder, and create a new Flex project.  On the dialog that comes up, select the “Configure Flex SDKs” on the middle right of the dialog:

pic4

On the dialog that comes up, click the “Add” button, and browse to the 4.0.0 AIR 2.0 folder you created earlier:

pic5

pic6

Then, select the “Ok” button, and your dialog should look like this:

pic7

Once you’re done, click the “Apply” button, and then click “Ok”.  Then, under the “Flex SDK version” part of the dialog, select the “Use a Specific SDK” radio button, and select your new SDK from the select box.  From here on out, setting up your project is normal.  Note that unless you made your new SDK the default, you will have to manually select your SDK every time you create a new application that leverages the AIR 2.0 SDK (including UcompOS applications).

pic8

The final topic I wanted to touch on was getting your publisherID that you need to add to your application descriptor file in order to make it work with UCompOS.  The easiest way to do this is to export a release build of your AIR application and install it.  Once that’s done, you will need to browse to the location where you installed the AIR application, and browse to the “META-INF/AIR” folder.  In that folder, you will see a file called “publisherid” that contains the value that you need to set for publisherID in your AIR application descriptor file (don’t forget to set allowBrowserInvocation to true!):

pic9

I hope some of these tips help you out as you work with UcompOS.

About Tom Petz

Comments are closed.