Today I was just trying to see how to launch one AIR app from another… The idea struck me when I was reading -Installing and running an AIR applications from a web page documentation on livedocs and I thought it is worth posting here.
There is an air.swf file file at [http://airdownload.adobe.com/air/browserapi/air.swf]. One can invoke a launchApplication() method on the file to interact with the AIR runtime and launch installed AIR applications from a web page in a browser. I decided to use the same file to launch AIR apps from another AIR app. To get this working, the trick is very simple:
- Get the applicationID and the publisherID of the app intended to be invoked
applicationID can be obtained, either from the author of the application or looking at the application.xml file funder the META-INF/AIR folder in the application install directory.
publisherID can be obtained, either from the author of the application or in the publisherid file under the META-INF/AIR folder in the application install directory.
- First load the air.swf in an instance of the Loader class and set the LoaderContext as mentioned here under “Loading the air.swf file” heading.
- Do a check if the application is installed using the code under “Checking from a web page if an AIR application is installed” heading.
- Use the following code to launch the application
var appID:String = enter applicationID here;
var pubID:String = enter publisherID here;
airSWF.launchApplication(appID, pubID); - Done…
Note:
This would only work if the application.xml file of the application that you want to launch has the allowBrowserInvocation property set to true.
Here is an example of 2 apps, AIRAppLauncher and AIRAppLaunched. AIRAppLauncher can be used to launch AIRAppLaunched. You will have to sign the AIRAppLaunched, export as AIR, extract the publisherID, install it and use that in AIRAppLauncher for the whole workflow to work. You can download the archive here…


December 23, 2008 at 12:02 am |
Yeah, but I’d rather just have the ability to invoke all kinds of apps from an AIR app
AIR and the desktop need to better friends
Cheers,
Mrinal
December 30, 2008 at 9:02 am |
Hi,
i had mailed u regarding somethin few days back @ raghunath(dot)rao(at) gmail(dot)com, n i din get any response from u….
January 5, 2009 at 6:45 am |
Hey deepak… i didnt get it for some reason. Can you resend it?
January 5, 2009 at 2:34 pm |
Hi,
I have sent that email to you again. Please let me know if it has reached you….
tc,
Cheers,
Deepak
February 3, 2009 at 8:42 pm |
Hi,
Have tried your example. But does not work. Publisher Id and app id are specified. Says that version not found.
Using Vista, could that be a problem?
Also using a self signed certificate which is installed as a trusted authority..
March 23, 2009 at 12:19 pm |
Hi Usman Khan,
Be sure the call to do the load is in response to user event like ‘click’… Notes the author mentions above as links to adobe (I can post a link here Due to security that will through this post away otherwise
).
I did get it to work with a dev certificate in this case.
-gabriel
May 27, 2009 at 9:57 am |
Hi Raghu,
nice example. I want to run an parallel child application which will update the stored data of the parent application. Is that possible using air.
Thanks
- Rahim