android-js / androidjs

Platform to build android app using node js
MIT License
463 stars 109 forks source link

Open app from external source #142

Open deefeloper opened 3 years ago

deefeloper commented 3 years ago

Is your feature request related to a problem? Please describe. I would like to specify what app to load instead of it defaulting to index.html (like nw.js for windows/linux)

Describe the solution you'd like A way to specify which entry point to start at (through package.json)

Describe alternatives you've considered run windows 10 in virtualbox on android to use nw.js

Additional context It seems android-js is hardcoded to load views/index.html it would be nice to start a regular .js file containing node.js code or have it point to an external url to load that resource

Chhekur commented 3 years ago

@deefeloper we actually provided a loadURL function which you can use to load another url from index.html, look at the docs if it solves your purpose otherwise let me know. we can fix this ; )

join our slack here androidjs.slack.com

deefeloper commented 3 years ago

@deefeloper we actually provided a loadURL function which you can use to load another url from index.html, look at the docs if it solves your purpose otherwise let me know. we can fix this ; )

join our slack here androidjs.slack.com

Correct, this is a working workaround. This does however require more html and js code to maintain that is not integrated with the rest of the platform. I run a node.js api and vue frontend which reside on a webserver and I would like to open it directly and in Vue I could detect if it's running in a node.js enabled engine so it can use some system calls.

Basically I would like to use androidjs like NW.js (which I think was the original goal of this project). NW.js allows to bundle an application with assets but also just load it in from an external source, additionally you can just load a .js and control the "window" from code.

Later on I would like to run some native node.js inside the vue app code for example to control specialized equipment like thermal printers and highspeed barcode scanners.

For now I use the index.html as a "loading" screen of sorts and just run loadURL, which conveniently hides the fact it has a built-in app/view.

I'll post more findings after I discover how much I can do that I cannot do with chrome for example!