Vaadin as desktop application

Hi All,

I am trying to learn vaadin (basically trying to learn web application framework so you can assume me as novice to these technologies). I was looking into the API documentations and even some books but I didn’t find much reference how we can use Vaadin to develop desktop application.
I have below some of the queries

  1. Can we use Vaadin as desktop application.
  2. Can we use Vaadin API to access native file systems to read directory informations for e.g. to open files for read only formats etc.

May be these questions seems to be basics but still it would be great if I get some pointers on the same.

  1. If you mean a seperate application started by for example a .exe file which runs without a browser and without an internet connection then I have to say no. Vaadin is a Web Application Framework with a Java backend running on a server and a Html/javascript front-end which is running on the client (Sry if i misused some of these terms). There presumably is a way to create a Offline app with Vaadin 7 using the EntryPoint class but i never tried it and so don’t really know how/whether it works. If it does the Application would still have to run in a Browser.

  2. Because of security reasons direct access to the clients file system through Vaadin code isn’t possible (should also be blocked by the Browser if Vaadin would try to do so). You can access files which are on the server in a directory accessible by the app (for example the apps resource/theme folder). To access files on the client you either have to do it by using the Upload component (so the client has to manually upload the file he wants) or integrating a Java Applet (I only heard about that one but never tried it myself).

And to expand a little on what Marius said: to do this you would probably need to run the server (e.g. embedded Jetty) and a browser (embedded WebKit?) in the same process or at least started together. Or for a much simpler solution, you could rely on the locally installed browser, in which case the user would interact through it but the server and launching the browser would be handled by your single executable file. In either case, the server running on the same computer could access local files, and it is possible to configure the server to only accept connections from localhost.

This is possible to do (e.g. Vaadin Visual Editor does something like that inside Eclipse) but I can’t give a step-by-step guide.

Since this topic is still getting traffic, I wanted to update that the best way to build a Vaadin “desktop” application today is to add a @PWA annotation, which makes it installable on both desktop and mobile and enabling things like sending push notifications. You can find the docs here: PWA | Configuration | Vaadin Docs