0

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

  1. It needs heavy graphics and using OpenGL & OpenGL ES

  2. 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).

  3. 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)

9
  • Side note: Gluon and the community is providing JavaFX support for Android and iOS. Maybe this is a path you could consider as well. Commented Jan 23, 2017 at 12:54
  • Yes, I knew it from one of the link I pasted in question but as mentioned due to complexity of developing GUI with JavaFx, I wished to switch to Web technology. Commented Jan 23, 2017 at 13:13
  • You could have a look at WebRTC and related technologies: de.wikipedia.org/wiki/WebRTC, de.wikipedia.org/wiki/Secure_Real-Time_Transport_Protocol Commented Jan 23, 2017 at 13:56
  • I would recommend Gluon as well. Their technology works, and the support from them is great. This allows the same code base across Desktop/Android/iOS/embedded. Commented Jan 23, 2017 at 14:26
  • @Puce WebRTC is again client-server model which I wish to avoid as my desktop application has neither J2EE code nor REST based. Commented Jan 24, 2017 at 7:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.