Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Electron and Cordova for Windows build [closed]

Electron can allow to develop desktop applications (.exe) using JavaScript, HTML and CSS. It is based on Node.js and Chromium

It seem I could also do the same using Cordova but what Cordova couldn't do that Electron can (In term of desktop applications)?

I need to build an App that can do full screen, use AppCache (manifest) and store data using IndexedDB. It need to work well with Barcode Scanner and Serial Port communication (eg: https://github.com/voodootikigod/node-serialport)

like image 718
I'll-Be-Back Avatar asked Feb 03 '16 23:02

I'll-Be-Back


People also ask

What types of builds does Cordova build electron support?

There are two types of builds: A debug/development and release build. By default, with no additional configuration, cordova build electron will build default packages for the host operating system that triggers the command. Below, are the list of default packages for each operating system.

How do I build electron app for Windows?

On macOS/Linux you can build Electron app for Windows locally, except Appx for Windows Store (in the future (feel free to file issue) electron-build-service will support Appx target). You can use build servers — e.g. Travis to build macOS/Linux apps and AppVeyor to build Windows app.

What is the difference between electron and Apache Cordova?

Apache Cordova is a platform for building native mobile applications using HTML, CSS and JavaScript. It seems like the main difference is that Cordova targets mobile platforms and apps first and foremost, while Electron is primarily focused on desktop platforms and apps.

What is electron-build-service used for?

Free public Electron Build Service is used to build Electron app for Linux on Windows. On macOS/Linux you can build Electron app for Windows locally, except Appx for Windows Store (in the future (feel free to file issue) electron-build-service will support Appx target).


1 Answers

Apache Cordova is a platform for building native mobile applications using HTML, CSS and JavaScript.

It seems like the main difference is that Cordova targets mobile platforms and apps first and foremost, while Electron is primarily focused on desktop platforms and apps. Cordova does appear to support Windows, Ubuntu, and OS X desktops to some extent, however they do mention the following in the OS X repository:

Note that the current focus of this cordova platform is to provide kiosk-like applications for OSX, that usually run fullscreen and have little desktop interaction. So there is no direct support for menus, dock integration, finder integration, documents, etc. Think of it as a mobile app running on a very big screen.

It also appears that Cordova's plugin system is not directly compatible with regular NPM packages and native NodeJS addons, so you will probably have to create some sort of plugin wrapper for node-serialport before you could use it in a Cordova app, or perhaps use an existing plugin.

like image 71
Vadim Macagon Avatar answered Sep 26 '22 03:09

Vadim Macagon