Wednesday, January 21, 2009

Open file from AIR using Merapi bridge

When I finished with vista style experiment I was thinking what if merapi could help to open files from AIR application. On the screen cast below I will show AIR application which could open MS Office file:

Before run my AIR application I needed to start java bridge (java project from Eclipse). I decided to zip all needed libraries into one runnable JAR file and run it from BAT file. But I still wanted to make one runnable file to start java bridge and AIR application together. One day, browsing on Merapi forum I found entry with solution to my problem. Using NSIS installer author has been built exe file.
The Bridge class from the Merapi library has a method called systemExecute with one string parameter Path. I tried to use this method with path to notepad.exe file, but in the result I had an error on Java side. I think this method was added to implement such feature as executing files from AIR application. Will check with new version of the Merapi library.

Update: Source code for Java project and for AIR project. In the java archive you could find runnable .jar and .bat files.

1 comment: