[英]Communication between javascript and its hosting java or c++ application
[英]Communication between Java Application and C++ Application
我正在嘗試為Java應用程序編寫一個插件。 該插件應該能夠告訴Java應用程序已經識別出新事件(觀察者設計模式,輪詢......這不是重點)。 問題是事件是來自Microsoft Kinect控制器的跟蹤手勢(因為我必須使用C ++和Microsoft Kinect SDK)。 這意味着我必須在Java應用程序和我的Kinect應用程序之間進行通信。 我想到了類似於適配器設計模式的東西,其中Java應用程序“包括”接口(c ++頭文件,DLL等)。 首先我想到了JNI,但后來我必須編寫一個將在兩個應用程序端使用的DLL,對吧? 我想到的另一件事是通過UDP(或更輕量級的東西?)等協議提供手勢數據。 我聽到的最后一件事是寫一個COM +匯編......但說實話,我對COM +的了解相當少。
JAVA APPLICATION << ----- ??? ----- >> KINECT APPLICATION
JNI (Java Native Interface) allows the java application to call c/c++
methods.
All this requires that we have a means of communicating (Integrating Java
with C++) between Java and C++. This is provided by the JNI (Java Native
Interface).
For a practical example of using the JNI.
Calling native methods from Java see this url
https://www.javaworld.com/article/2077513/learn-java/java-tip-17--integrating-java-with-c--.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.