I know that you can use electron for cross platform applications (windows, macos, linux) but is there a way to get it to run on android?
I know it's a few months late but yes, you can. Apache Cordova uses Electron as one of its platforms and this seems to work like a charm.
Cordova normally creates apps for Android and iOS using JS but with the Electron platform, it can create all the Electron outputs as well like Windows/Mac/Linux by including node.js.
Electron means "Webview"(based on Chromium) is connected to javascript outside (I emphasize outside since inside a Webview, we can always use javascript). And the javascript is in particular nodejs. By the way, Chromium "webview" connected to python is "CEF Python", which is exactly parallel to electron.
On android, for the usual webview(also based on Chromium), its outside is connected to Java VM. If we want to use this webview, and its outside connected to javascript, this connection is through Java VM. Either a JS engine runs in Java VM or this one https://github.com/nodejs-mobile/nodejs-mobile-cordova.
The other option is to build the webview from Chromium by ourself. With this approach, java VM is not involved. This is:
- for android: https://chromium.googlesource.com/chromium/src/+/main/docs/android_build_instructions.md (seems should "Build Content shell" rather than "Build WebView" which also connect to Java VM)
- for iOS: https://chromium.googlesource.com/chromium/src/+/main/docs/ios/build_instructions.md
And its outside can be connected to Javascript directly, to execute JS, we need a JS engine for the outside javascript. JS engine is not only to execute JS code, but also to provide environmental support. This is https://github.com/nodejs-mobile/nodejs-mobile
© 2022 - 2024 — McMap. All rights reserved.