Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Communication between Java Application and C++ Application

I'm trying to write a plugin for a Java Application. The plugin should be able to tell the Java Application that new events have been recognized (Observer Design Pattern, Polling ... thats not the point). The problem is that the events are tracked gestures coming from a Microsoft Kinect controller (I´m using C++ and the Microsoft Kinect SDK because I have to). So that means I have to communicate between the Java Application and my Kinect Application. I thought of something like an adapter design pattern where the Java application is "including" the interface (c++ header file, dll etc.). First I thought of JNI but then I have to write a DLL that will be used on both application sides, right? Another thing I thought of was to provide the gesture data via a protocol like UDP (or something more lightweight?). The last thing I heard of was to write a COM+ assembly ... but to be honest my knowledge about COM+ is rather little.

JAVA APPLICATION << ----- ??? ----- >> KINECT APPLICATION
like image 626
seveves Avatar asked Feb 22 '23 05:02

seveves


1 Answers

May be you should have a look at google's Protocol Buffers.

Since you are considering JNI. I'd suggest you refer to this IBM tutorial.

JNI allows the java application to call c/c++ methods and vice-versa.

Also have a look at this question, if you are calling java from c++.

like image 176
Sorter Avatar answered Feb 23 '23 17:02

Sorter