I have a working desktop application with JavaFx as Front-end and java as back-end language. This was fine till I had requirement to have some special functionality of same application working on mobile device too (2-3 years back). So android app was created (it was first target OS) which implements those new functionality (few overlapped functionality duplicated). Desktop clients and android clients sync information with P2P protocol.
This is fine till now but eventually finding very difficult to maintain separate code where GUI is almost similar. Another issue is achieving richer GUI experience with JavaFx client and Android (though getting native look). It is very tedious to create complex components like tree or nested complex tables with JavaFx.
After study recent trends, I am convinced that I should use HTML5/CSS3/JavaScript based GUI which I can package as per requirement for different devices (e.g. Electron for desktop and Cordova for mobile). I see advantage that my basic html code will remain same.
Now problem here is, I don't want to use node.js on server side and want to continue with my java back-end. If I rewrite full GUI with web technology, what is best option to communicate with my java code.
Note that i don't want client-server model to avoid embedded server overhead (so having REST service is out of scope).
Some details about project
It needs heavy graphics and using OpenGL & OpenGL ES
Currently GUI (JavaFX or Android ) are communicating by making direct call to Java back-end code (from GUI -> Back-end) and raising event (Back-end -> GUI).
New version is delivered to users with new binaries, so no auto update require.
I see first requirement will be fulfilled with WebGL supporting framework/toolkit. I am looking how to implement 2nd point from above.
I gone through some quetions like below but they are all talking about either client-server based architecture or embedding browser in JavaFx (WebView or JxBrowser) or directly porting JavaFX app on android with JavaFX-Android SDK but as per my requirement, I neither want client-server not continue with JavaFx.
Pure Java HTML viewer/renderer for use in a Scrollable pane
How to use HTML and CSS as a Java application GUI?
Is it possible to create Desktop Application using Java backend & Web Technologies UI
So summing-up - Provided I use Web technology, what are ways to communicate from GUI to Java and vice versa for not server base application. The one I found was node-java but not sure if it is right approach and can rely on for future java versions (currently using java 1.8)