For an exercise, I would like to develop an application in Java that can make calls to Windows API and register itself for notification on events like key press.
From researches done earlier, I understand that the specific Windows API suitable for my need is the SetWindowsHookEx function.
Some have suggested using JNI for this, and others JNA. For the scenario I have described, What are the pros and cons for using either JNI or JNA?
I need opinions on how best to approach solving this problem.
Please do note guys, that I am aware that C/C++ would be most suitable for what I am doing. But like I stated right from the beginning - I am doing this as an exercise, and thus I want to accomplish it using Java.
This question is not a duplicate of Calling Win32 API method from Java, for the following reasons:
- My question asks, what are the pros and cons of using JNI or JNA.
- The other questions asks
how to call an already existing DLL from Java
They are just not the same questions.