1

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)

Community
  • 1
  • 1
ashah
  • 169
  • 2
  • 12
  • Side note: Gluon and the community is providing JavaFX support for Android and iOS. Maybe this is a path you could consider as well. – Puce Jan 23 '17 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. – ashah Jan 23 '17 at 13:13
  • You could have a look at WebRTC and related technologies: https://de.wikipedia.org/wiki/WebRTC, https://de.wikipedia.org/wiki/Secure_Real-Time_Transport_Protocol – Puce Jan 23 '17 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. – purring pigeon Jan 23 '17 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. – ashah Jan 24 '17 at 07:20
  • @purringpigeon I would look at Gluon as last resource as I wish to get away with JavaFx due to reason mentioned above Meanwhile I came across [ZeroMQ](http://zguide.zeromq.org/) where you can do communication across language and looking forward if it suits my requirement. – ashah Jan 24 '17 at 07:21
  • If you want simply call a server - can you use HTTP? If so look at Apache HTTP Client – purring pigeon Jan 24 '17 at 14:52
  • For PC Part: Could you confirm you want Web-browser <---> on-local-machine-Java-Code ? if that is it you need to use local Http Server for each PC, you can embed Jetty on your code and make it act as gateway web-browser<-->local-http(Jetty)<--->other protocols (Ex: TCP/IP) – Ahmed Gawad Feb 08 '17 at 07:52
  • @ahmed-gawad It is desktop application which I wish to develop with web technology. With framework like [Electrons](electron.atom.io), you can run application inside embeded browser and get dektop like look, i.e. user doesn't need to open application in browser. Only issue is the whole application need to be written as nodejs app while I wanted to reuse my java classes as BL and only PL should be using web technology and no overhead of server like jetty. – ashah Feb 15 '17 at 12:53

0 Answers0