Windows 构建的 Electron 和 Cordova
Electron and Cordova for Windows build
Electron 允许使用 JavaScript、HTML 和 CSS 开发桌面应用程序 (.exe)。它基于 Node.js 和 Chromium
似乎我也可以使用 Cordova 做同样的事情,但是 Cordova 不能做而 Electron 可以做的事情(就桌面应用程序而言)?
我需要构建一个可以全屏显示的应用程序,使用 AppCache(清单)并使用 IndexedDB 存储数据。它需要与条码扫描器和串口通信良好配合(例如:https://github.com/voodootikigod/node-serialport)
Apache Cordova is a platform for building native mobile applications using HTML, CSS and JavaScript.
主要区别似乎在于 Cordova 主要针对移动平台和应用程序,而 Electron 主要针对桌面平台和应用程序。 Cordova 确实在某种程度上支持 Windows、Ubuntu 和 OS X 桌面,但是他们确实在 OS X 存储库中提到了以下内容:
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.
Cordova 的插件系统似乎并不直接与常规 NPM 包和本机 NodeJS 插件兼容,因此您可能必须先为 node-serialport
创建某种插件包装器,然后才能在Cordova 应用程序,或者使用 an existing plugin.
Return 经验:我用 Cordova 构建了一个移动应用程序,非常适合 Android 和 iOS。不幸的是,当我想在桌面上部署该应用程序时,我发现对这些目标的支持非常差(缺少基本插件,配置有限)。
结论:Electron 似乎更适合桌面应用程序。
Electron 允许使用 JavaScript、HTML 和 CSS 开发桌面应用程序 (.exe)。它基于 Node.js 和 Chromium
似乎我也可以使用 Cordova 做同样的事情,但是 Cordova 不能做而 Electron 可以做的事情(就桌面应用程序而言)?
我需要构建一个可以全屏显示的应用程序,使用 AppCache(清单)并使用 IndexedDB 存储数据。它需要与条码扫描器和串口通信良好配合(例如:https://github.com/voodootikigod/node-serialport)
Apache Cordova is a platform for building native mobile applications using HTML, CSS and JavaScript.
主要区别似乎在于 Cordova 主要针对移动平台和应用程序,而 Electron 主要针对桌面平台和应用程序。 Cordova 确实在某种程度上支持 Windows、Ubuntu 和 OS X 桌面,但是他们确实在 OS X 存储库中提到了以下内容:
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.
Cordova 的插件系统似乎并不直接与常规 NPM 包和本机 NodeJS 插件兼容,因此您可能必须先为 node-serialport
创建某种插件包装器,然后才能在Cordova 应用程序,或者使用 an existing plugin.
Return 经验:我用 Cordova 构建了一个移动应用程序,非常适合 Android 和 iOS。不幸的是,当我想在桌面上部署该应用程序时,我发现对这些目标的支持非常差(缺少基本插件,配置有限)。
结论:Electron 似乎更适合桌面应用程序。