Monday, December 28, 2009

So I was able to use adl. This is fun, but really what I want to do is make air files. To do this, I need to use adt (the Air Development Tool), and I need a certificate.

Adt Without a Certificate

If you just use adt without specifying a certificate, you get an intermediate air file. The convention is to give such an intermediate file an airi extension; een if you don't, even if you call it an air file, it's still an intermediate file.

Do a

adt -prepare HelloWorld.air HelloWorld-app.xml HelloWorld.swf

and get



Making My Own Certificate with KeyChain Access

Now I tried making a certificate using my Mac's Keychain Access program. I found that I could not make it in the System Keychain. But I could make it in the login keychain and then move it to the System Keychain. Then, I can export it. I called it TedKubaska002.p12. When I try making an ai file with this certificate, I get an error. The HelloWorld.air file is not created.

newtricks:HelloworldplusCert ted$ adt -package -storetype pkcs12 -keystore TedKubaska002.p12 -tsa none HelloWorld.air HelloWorld-app.xml HelloWorld.swf
password:
Unknown or invalid signature algorithm.
newtricks:HelloworldplusCert ted$

Using the Sample Certificate in the Download

The example code for the TY book I am reading does come with a sample certificate called myCert.p12. I can use that.

newtricks:HelloworldplusCert ted$ adt -package -storetype pkcs12 -keystore myCert.p12 -tsa none HelloWorld.air HelloWorld-app.xml HelloWorld.swf
password:
newtricks:HelloworldplusCert ted$ ls *.air
HelloWorld.air
newtricks:HelloworldplusCert ted$

I get a HelloWorld.air file, and if I click on it in Finder, I get




Click on Install.




Click on Continue.




 

How to Make and Use My Own Self-Signed Certificate

But you know, what I really want is my own self-signed certificate. Here's how I can get that. I removed the HelloWorld.air to ensure that I'm getting a new one.

newtricks:HelloworldplusCert ted$ adt -certificate -cn TedsHome -ou TedsCB -o TedsHome -c US 2048-RSA TedKubaska003.p12 ted128
newtricks:HelloworldplusCert ted$ adt -package -storetype pkcs12 -keystore TedKubaska003.p12 -tsa none HelloWorld.air HelloWorld-app.xml HelloWorld.swf
password:
newtricks:HelloworldplusCert ted$ ls -l *.air
-rw-r--r-- 1 ted staff 404961 Dec 28 11:27 HelloWorld.air

To try our the new HelloWorld.air, first delete the HelloWorld.app that the last example put in /Applications. Then, if I click on the new HelloWorld.air, it acts like before. My self-signed certificate works ... just like the one I got in the example download.

What I find curious is why I couldn't make a working self-signed certificate with Mac's Key Chain application.



Air
12/28/2009 11:54:26 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Sunday, December 27, 2009

OK, I hear so much about Adobe Air., I have to try it out. Air is Adobe's way of letting us build rich desktop applications.

The unfortunate thing about using Air is ... well, the cost. It looks as if you can get the Air runtime and the SDK for free, but Flex Builder 3 costs. And I think you really need Flex Builder 3 to do anything for real.

Flex Builder 3 is an Eclipse plugin, but it's not clear from the Adobe site what versions of Eclipse are supported.




You can get Flex Builder as a standalone (I guess it comes with an integrated eclipse) or as a plugin (but you can't move beyond Eclipse 3.4).

Even worse, Adobe says that Flex Builder does not work on Snow Leopard (http://www.adobe.com/support/OScompatibility.html ) ... or is not tested on Snow Leopard. The web seems contradictory on this point.

Even so, Flex Builder is a deprecated term. The new deal is Flash Builder. I went to this website: http://labs.adobe.com/technologies/.




So I'm going to try and install the beta 2. There's a 60-day time limit on this beta. This is also unfortunate. Flex or Flash Builder is just too expensive for me to use.

Reading This Book

I'm reading Teach Yourself Adobe Air Programming in 24 Hours by Michael Givens. Now I know that the Teach Yourself series gets a lot of bad press on the net ... comments like it takes a lifetime to become a software engineer or how a little knowledge is dangerous or other such pompous comments. It is an unfortunate naming convention ... agreed, you can't learn Adobe Air, Java, C++ or anything else for that matter in 24 hours. But these books are structured as a series of short exercises, each with a clear solution. They take you through installing, configuring, and running simple examples. They're like “get up and running” books, and I like them.

Here's my complaint, though. It's the latest book I could find (2009 copyright), but it still discuses Flex Builder 3, which as much as I can figure out is a defunct name and a defunct version.

Downloads and Installation

You know every time I go to the Adobe site and download something, it seems I often go to a different place.

Here is what I downloaded (Note the dmg extensions ... I'm on a Mac Book Pro with Snow Leopard).

You know you got it installed correctly if you type adl (this stands for Adobe Debug Launcher) and you find it. Like ...

newtricks:Adobe ted$ adl
application descriptor file not specified
usage:
adl ( -runtime <runtime-dir> )? ( -pubid <pubid> )? -nodebug? <app-desc> <root-dir>? ( -- ... )?
adl -help
newtricks:Adobe ted$

Download Flex Builder 3 Trial version from http://www.adobe.com/cfusion/entitlement/index.cfm?e-flex3email It seems you can get this from two places in the Adobe world. Here's another place. http://www.adobe.com/cfusion/entitlement/index.cfm?e=flexbuilder3

I'm in Hour 2 of that Teach Yourself book. It doesn't tell me until Hour 4 that it recommends using Flex Builder. But I think when that time comes, I'll try the Flash Builder beta 2 because of Flex Builder's issue with Snow Leopard.




Examples

You can download a zip with examples for this book from http://www.informit.com/store/product.aspx?isbn=9780672330308

The book also lets you download examples for each hour separately from another site. The examples for Hour 2 are http://www.airination.info/airtraining/tyairin24/Helloworld.zip and http://www.airination.info/airtraining/tyairin24/HelloworldplusCert.zip .

You need the one with a certificate to package the example for distribution (certificates are discussed in Hour 3), but you can run it with adl without a certificate.

I don't think it's right to show the xml and html here. It's not my code. It's easily downloadable form the links I gave.

newtricks:AirApps ted$ adl hello_world-app.xml

Sun Dec 27 15:21:42 newtricks adl[1019] <Error>: The function `CGContextSetFontRenderingMode' is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance. Please use `CGContextSetFontRenderingStyle' instead.



Now that message about the obsolete function. I get that if the <content></content> in hello_world-app.xml contains an html filename (I typed in the html file listed in the book). I don't see that message if the content contains the swf filename that came with the examples download.

newtricks:AirApps ted$ adl HelloWorld-app.xml



Air
12/27/2009 6:14:45 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  |  Trackback