Is there one or several java based technology that can help me write an application code base once (including Logic-Views-Controllers) and then compile and run it for all platforms including main desktop and mobile operating systems as well as in the browser. It must work and save in offline mode too so that it could sync with remote server as soon as it is connected to the internet. To me, it seems there must be a way if I use some sort of html/css/js technology to handle my views for such an application since I don't need fancy operating system dependent view technologies, and java for Logic and controllers. So far I have found Oracle ADF Mobile which seems to be commercial, eclipse RAP, eclipse scout .... But I look for something that covers Desktop as well. In addition if I can make the application run only in web browser, in case it would run and save in offline mode, it would be fine enough for me.
3 Answers
You could use Eclipse Scout for this with the following setup/limitations:
- Since June 2016 Scout only supports web UIs (until 2015 Scout also had support for Swing/SWT, but this is gone now)
- You would need to run the Scout frontend model part in a local Tomcat or similar
- You would need to add the sync code for connecting the Scout frontend model with the Scout backend (that would sync data once a client installation gets online)
Asking for a mobile solution in combination with Java will most likely put you in a messy situation, especially with the discontinuation of RoboVM
Hint: The Scout team has started working on JS offline capability of the Scout UI. However, this is effort is still many months away from production quality (many parts/concepts still missing, not all parts open source, no documentation, etc.)
Addition: You will have the same limitations with Eclipse RAP (needs a frontend server, only web based, hint: styling rap apps is hard).

- 371
- 1
- 6
-
I just wonder why we dont have a the chance to use the same html/css/js we use in web in technology like JSF/Facelets in something like JavaFX. I also wonder why java is called portable if you cant run it on ios. so many wonders ... – Mohammad Rahmani Aug 23 '16 at 11:02
-
could you please vote up this question because they have banned me from questioning thank you. – Mohammad Rahmani Sep 04 '16 at 21:14
Looking for the silver bullet... Beware that "not caring about something" (the OS) will make you care a lot about a framework that does the "dirty work".
Leaving opinions aside, in 2016 you will reach your goal quicker with JavaScript, it has become the only thing supported everywhere.
It may be a good deal if you're OK with JS, and living on the bleeding edge with heterogeneous / less mature tooling (see NPM gate).
Java in the browser (applets) is dying soon due to its well documented security issues. One could argue it's been dead for a long time.
If you do want to code in Java only, GWT is still alive. It compiles your Java code into highly efficient JavaScript.
However, ever since Google reduced its involvement by giving away the project to a steering committee, the developments have slowed down drastically, and I'm not even sure they are up to date with JDK 8 yet.
Google still uses GWT in projects like inbox, for what it's worth.

- 3,457
- 1
- 28
- 45
-
The problem is javascript, even under the hood of modular node js is less maintainable and readable. It changes so often and other developpers in the team could make so much damage. I cant rely on javascript. But have you seen vaadin ? What do you think of it ? It's touchkit is free? – Mohammad Rahmani Aug 23 '16 at 10:58
-
2I have worked with GWT for years but never actually went further than "Hello worlds" with Vaadin. They make a lot of advertising and have been offering commercial support for years, and their documentation is very complete. I would humbly suggest you to make your own opinion technically, as I can only tell that the company is reliable. FYI they are slowly "moving away" from GWT though, the Vaadin guy I saw in Berlin around january 2016 tried to shake the perception that "Vaadin was only GWT". – Michael Técourt Aug 23 '16 at 12:10
-
Vaadin offers an [offline mode](https://vaadin.com/docs/-/part/touchkit/mobile-offline.html) . But I don't actually understand if it is free or not. I don't uderstand if Oracle ADF mobile is also free to use or not. – Mohammad Rahmani Aug 23 '16 at 15:47
-
could you please vote up this question because they have banned me from questioning thank you. – Mohammad Rahmani Sep 04 '16 at 21:14
I would go with GWT.
Google also uses this for projects like the inbox webapp, and the inbox android app. Using GWT a lot of code between the two apps can be shared.
It is also possible to compile as a windows desktop application.

- 2,077
- 1
- 16
- 24
-
-
1GWT just compiles to JS, so there is no difference in the way you handle losing connectivity, or using [local storage](http://www.gwtproject.org/doc/latest/DevGuideHtml5Storage.html). – Michael Técourt Aug 23 '16 at 15:06
-
-
If you're into JSF yeah sure, like I said you can use GWT wherever you use JavaScript. – Michael Técourt Aug 24 '16 at 07:58
-
@MichaelTecourt could you please vote up this question because they have banned me from questioning thank you. – Mohammad Rahmani Sep 04 '16 at 21:13