Experimenting with Adobe AiR

Silverlight Logo

I was under a false impression. I've been using Twhirl for my Twitter client needs as it was the most feature complete client i could find. Twhirl requires the Adobe AiR runtime to work. I thought that AiR was a wrapper around Flex to allow desktop installation of Flex. What I didn't understand was that AiR is a runtime to allow Flex, Flash and HTML/AJAX apps to be hosted as a windowed desktop application. Interesting...so AiR isn't necessarily about Flex, but for all three platforms.

HTML/AJAX you say? Silverlight 2 is hosted on HTML. Could I do the scandalous thing and make my Silverlight 2 application run as an AiR application? It was to the SDK I ran.

With the AiR SDK in hand, I followed their walk-through to create my first small AiR app.  Its an interesting model that creates AiR apps out of a bunch of resources. So, in theory Silverlight could work. Silverlight.js, .xap files, and other resources are just files.  It should work...but it doesn't. The problem is that when hosted in AiR, the Silverlight ActiveX object doesn't want to be created.  I am not sure if this is an issue with AiR or Silverlight. I've seen examples of other web-friendly ActiveX (or object tags) working (e.g. PDF Viewer) in AiR, so my guess is Silverlight 2.

I didn't expect to get much in the way of examples from other people, but I did expect to find some good community support for AiR...but even the Adobe public forum for AiR had zero messages (I think its broken, not empty).

So I plead to my readers: if any of you know of any good AiR resources (developer-to-developer preferred), please add a comment here.  It'd be cool to actually get this to work.

Comments:

Gravatar

Hmm. I have been thinking about using Mozilla Prism to host Silverlight applications on the desktop. It uses the Mozilla core and XULRunner. I just haven't gotten around to trying it out. If you get there before me, let me know.

KevinHazzard on Twitter.com

Gravatar

I don't think this is a good way to handle this sittuation, why do i need to use adobe air? if the Microsoft main focus is let SL like WPF, so I suppose would be extremely easy to run on desktop, and another interesting thing..why you woul want to run desktop if you can run browser on a desktop?

Gravatar

I'd be interested in hearing about Silverlight applications that use Gears. AiR, Prism, Gears... seems like all are racing for the "offline web client" holy grail. It'll be interesting to see who wins!

Gravatar

ThoseBug,

I agree with you. Its more an exercise to see if it works (as going from SL to WPF does require two builds and tweaking of code/xaml), but not really a great use of the technologies.

Gravatar

Peter,

AiR and Gears are both not working with SL2 right now. Gears has an issue with how the HTML stack in SL2 work that I am hoping will be fixed in RTM. I haven't tried Prism yet. Though I do agree with others who think that offline isn't as interesting. (Offline versus desktop are two different issues...see Twhirl as a desktop app that certainly isn't offline).

Gravatar

Kevin,

Let me know if it works for you...though it still an academic exercise AFAIAC...I'd never recommend any of these solutions to clients. I was just surprised by AiR being for more than Flex and Flash.

Gravatar

Looks like this won't work. Tim Heuer pointed me at this:

http://casario.blogs.com/mmworld/2006/10/apollo_and_the_.html

which indicates that in AiR (Apollo was the code-name for AiR) that only PDF and Flash plugin's are special cased to work.

Gravatar

Remember that AIR is running Ajax on Webkit, so it's very much like Safari.

Does ActiveX run on Safari? I think you need IE to run ActiveX controls, don't you? PDF and Flash plugins aren't ActiveX controls when running on FireFox or Safari. I'm not sure about Opera.

Gravatar

Nosrenda,

I shouldn't say ActiveX, but stuff that support object tags. The Webkit stuff on OSX allows Silverlight to run as a widget (and SL is supported in FF, Safari and IE) so I don't think that's the problem...I think AiR is specifically prohibiting Object tags that aren't SWF and PDF.

Gravatar

In this case - you are correct. AIR is typed to specifically interact with PDF's. It is my understanding that this is because of several things. First, this increases security. Second, this preserves the cross platform capabilities. Third, it makes AIR a complete runtime. This way the end user won't have to install the runtime - plus three other plugins to get things working properly.

I must admit - even as a Flex / Flash / AIR developer, it would be interesting to see SL running on AIR.

Gravatar

Adobe have restricted 3rd party activex controls such as Silverlight from running inside Adobe AIR.

PDF is the exception.

--
Regards,

Scott Barnes
Rich Platform Product Manager.
Microsoft.

Gravatar

For AIR 1.1 (current version) the PDF and Flash player plugins are the only plugins supported within HTML content. This requires that those plugins are already installed on the users system.

As far as the AIR forums, which one did you visit? You can find the Adobe hosted AIR forums here:

http://www.adobe.com/go/airforums

you can also find a lower volume mailing list:

http://tech.groups.yahoo.com/group/apollocoders/

You can find more information on JavaScript and AIR at:

http://www.tostring.org/books/adobe-air-for-javascript-developers-pocketguide/1.0/en/

and

http://www.adobe.com/devnet/air/ajax/

@ThoseBug one advantage to running silverlight on the desktop via AIR is that it would allow you to deploy and run the app on multiple platforms (without having to develop different distribution and runtime mechanisms for each platform). But, as the post discusses, this is currently not possible.

Hope that helps...

mike chambers

mesh@adobe.com

Gravatar

Mike Chambers,

Great info. The Adobe Devnet link is good but it would be great to share those other links on the Adobe site. I should have thought to search for Apollo. Too bad it isn't possible (yet).

Gravatar

@shawn

No problem. I have already forwarded this to help raise the visibility of those links.

Btw, if you email me your shipping info, Ill send out a copy of the AIR / JavaScript book to you.

mike chambers

mesh@adobe.com

Gravatar

Some time ago, Tamir Khason showed how to make Silverlight be "AIR" using the WebBrowser control and a few other tricks:
http://blogs.microsoft.co.il/blogs/tamir/archive/2008/04/27/how-to-make-silverlight-be-air.aspx

Gravatar

Peter,

This is interesting but I was hoping for a non-.NET solution (e.g. OSX compatible).

Gravatar

This isn't what you're after (Silverlight on the OSX desktop?), but in the same vein..

Midnight Coders is working on an Adobe Air Windows & Unix client. No web server required, and deeper access to local resources. Another curious way to leverage Air..

http://www.themidnightcoders.com/blog/2007/07/weborb-air-edition.html

Gravatar

It's <strong>AIR</strong>, not AiR. Duh.


 



 
Save Cancel