简体   繁体   中英

Creating Desktop applications that run on web browser

In the last year I got to know that many developers started developing desktop applications that run on the web browser.

I am also trying to get into it and I'm trying to understand how I should start with such kind of development.

I first thought I should create a regular client-server application, ie with Apache Tomcat or with PHP, and for each launch of an application, to launch a new server on localhost and to open a browser that will load the application.

I've lately got to know that there are packages that do the server-client work for you, such as node-webkit.

I don't know where to start and I'm very confused...

When developers say that they develop desktop applications in Javascript or such that run on web browser - do they probably mean that the use node-webkit? Or does they do the complex structure I described above (JSP/PHP server on localhost) ?

The selection of technologies for building an application depends on the use of your application and the platform you want it to run on.

Web applications in contrast to Desktop applications are hosted and served by servers (like Tomcat) which are then requested and present to you by your browser.

Desktop applications are running on your local machine and they are independent from your browser. However node webkit, allows you to design applications using HTML and making them dynamic using node. The end result is a standalone application that runs as a browser emulation that is able to render and run software based on HTML and javascript. (In this case nodejs serves the application locally and the standalone web-app is the client).

Long story short node-webkit emulates the client-server model that is used for classic web apps, to build desktop applications.

It is an unorthodox way for doing things IMHO, but it might be a good start for getting into application development.

Many development models with web technologies exist, but they have different purposes and it all depends on what you want to do.

You seem to be mixing 3 models

Classic websites

A server (with PHP, Java or whatever) generates HTML.

A user uses a browser to access it.

When the user clicks somewhere, the server is called again and generates another HTML file.

Single Page Applications

This model is often used when writing websites that need a lot of interactivity. For example Gmail, or Google docs are SPAs (more or less).

SPAs are websites (you can access them at an URL) where all templating is done client side, and the webserver only exposes a HTTP API.

Most of the times, people use frameworks to make those like:

  • AngularJS
  • React
  • Backbone

Desktop apps with web technologies

That's just coding an application that you can install on a computer or phone with web technologies (javascript, css, html).

There is no server.

Tools that enable programmers to do this are

  • Node webkit (for desktops)
  • Cordova (for phones)
  • Many others

Most of the time, programmers also use SPA tools in conjonction with those to help them during development

Try this-

https://electronjs.org/

Build cross platform desktop apps with JavaScript, HTML, and CSS. With Electron, creating a desktop application for your company or idea is easy. Initially developed for GitHub's Atom editor, Electron has since been used to create applications by companies like Microsoft, Facebook, Slack, and Docker.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM