A few months ago I wrote a few posts dealing with how to create a Merapi AIR to Java production environment. If any of you have read those posts or tried doing it yourself you’d realize what a tricky and cumbersome process it is. Now with AIR 2.0, we have native process available which allows us to reduce this workload significantly. To really take advantage of this new functionality, I built an AIR 2.0 to Java communication layer called Transmission. No more custom installers, requiring Java to start AIR, and keep-alive processes to ensure Java is still running.
While architecting this, I decided I wanted to create an environment that would be familiar for people coming from Merapi. There is still a concept of Message objects and MessageHandlers which respond whenever a Message object with its registered type is passed across Transmission. The library is being hosted on Google Code and is licensed under the Apache 2.0 license which gives you the freedom to use it in commercial applications. I included a demo in the repo that should help you get started.
I’m not sure if it is just me or not, but when I kill the AIR application, I can still see the javaw.exe process still running. Though, it seems that the AIR docs say that the native process will be killed automatically. I don’t know if this is an AIR bug or a Transmission bug. Anyone else seen this?
Hi Rob,
Make sure to call Transmission.getInstance().exit(true) as your app closes to kill that process (I use the WindowedApplication close event normally). I forgot to add that to the demo app. I’ll be sure to update it.
thx… I also noticed that in Transmission.java there is a try/catch block that tries to find the .transmissionLog.log file. It if doesn’t find one, the FOS is null. But then the null FOS is used to create two TransmissionStandardStreams. As a result, in my app, it fails if I don’t have that log file. I’m not sure what is unique about my app that is different than the demo app except that, in my app, the handler is actually delegating the work to ANT. Perhaps something is trying to access it System.out? In any event, nothing is actually written to the file.
Hi Rob,
Verified your error. It’s a null pointer. I will get it fixed later tonight. As a work-around, if you create a file in your user home directory (~/Users/nross83 on Mac or C:\Documents and Settings\nross83 on Windows) called .transmissionLog.log. All the System.out.printlns in your project will be written to that file for debugging purposes. I always have this file so that’s how the error slipped through.
no problem… That’s exactly what I did to get past it too.
The fixes have been pushed up. Go ahead and update. If you have any more problems make sure to file a bug in Google Code.
Just what I’m looking for! I checked out the demo/air/TransmissionDemo folder assuming the demo/java/TransmissionDemo portion was not required. Modified my javaw.exe path to match mine. Now I get a Java Virtual Machine Error – “Could not find Main Class”. Do I need additional SVN files to access var transmissionControllerPackage:String = “transmission.demo.TransmissionDemoController”; ? Help.
-thanks Nate
Try SVN updating your TransmissionDemo Flex project (and your Transmission Flex library project as well if you checked that out too). I was able to reproduce your error and it should be fixed now.
Good luck!
Very cool! Have you tried this on AIR for Android yet? We need a simple way to communicate between a Java APK library and a Flex app.
Thanks! I haven’t tried it on Android yet, but I’ll look into it.
I tried out the Transmission but it use Nativeprocess to control IO message? It was not suitable to handle high load of data which will hang or crash. I wonder how Merapi fare compare to Transmission?
Just downloaded and ran the demo code from SVN, however, I simply get the AIR window and no message being passed. Java seems to be called OK since I can cause it to throw an error if I change the -cp slightly. Does anyone have a clue why when running the demo why it would be unresponsive? Using Eclipse / Java 1.6.0_22 / AIR 4.5 SDK
would transmission work in this type of scenario??
http://www.infoaccelerator.net/blog/post.cfm/rfid-enabled-air-applications-with-merapi
i’m building an AIR app that will communicate with an RFID reader.
Yes, Transmission will work for your RFID application. Looks like a fun project. Good luck!
Can we do remote aliasing like we can do in Merapi.
Something like this:
[RemoteClass(alias="com.greenplum.messages.ConfigMessage" )]
Hi vikram, yes you can. Transmission uses the same AMF serialization libraries as Merapi, BlazeDS, etc.
Hi Nate,
Awesome Implementation. I am loving it. I have converted merapi project into Transmission project and it just took me few mins to do it.
It works like a gem.
Thanks
Vikram Bhatla