JaneaSystems / nodejs-mobile-samples

Repository for demo applications that use Node.js on Mobile
MIT License
168 stars 111 forks source link

Native Gradle Sample using a Node Project folder - npm usage #6

Closed konraddysput closed 5 years ago

konraddysput commented 5 years ago

Hello,

I really try to run your application with my more complicated express application and I have few question:

  1. I think Im not sure how to run npm install before application start. Can you pleas describe how I should run npm install before node {mainfile.js}?

  2. Actually my application has a lot of packages. Here I have list of them:

"amqplib": "0.5.1", "animate.css": "3.5.2", "av-ts": "0.9.1", "bluetooth-hci-socket": "0.5.1", "css-loader": "0.28.7", "css-time": "0.1.12", "drivelist": "5.2.4", "electron": "1.7.9", "electron-process-manager": "^0.1.0", "express": "4.16.2", "hex64": "0.4.0", "js-base64": "2.3.2", "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "moment": "2.19.1", "moment-timezone": "0.5.13", "node-schedule": "1.2.5", "progress-stream": "2.0.0", "query-string": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz", "request": "2.83.0", "require-main-filename": "1.0.1", "roboto-fontface": "0.8.0", "screen-orientation": "^1.0.3", "screenshot-desktop": "1.1.0", "socket.io": "^2.0.4", "socket.io-client": "^2.0.3", "three": "0.87.1", "unescape": "1.0.1", "utf8js": "0.1.4", "vue": "2.5.0", "vue-devtools": "^3.1.9", "vue-loader": "13.3.0", "vue-template-compiler": "2.5.0", "vue-typescript-import-dts": "3.1.1", "vuex": "^3.0.1"

My question is - can I run my express application with these package by using your framework? (or I shouldn't try...)

  1. I know there are a lot of information about logging in class native-lib.cpp, but can you describe where can I access logs from my application?

Thanks a lot !

jaimecbernardo commented 5 years ago

Hi @konraddysput ,

  1. npm install is run before the application is built. The node_modules are included in the APK. Example:

    cd app/src/main/assets/nodejs-project
    npm install express
  2. Can't be sure about every module you list. Best way would be to give it a try. Though you seem to have some modules there that I think are for desktop only, like electron and screenshot-desktop, which probably won't work on mobile.

  3. The logs should output to Android logcat, which is the standard logging system for Android applications, which can be accessed either through the command line or Android Studio. I'd advise looking into using it. Here's some documentation that might be useful:

konraddysput commented 5 years ago

@jaimecbernardo Thanks for detailed information. Actually I run my express application. One more question - with express app working inside android application I will have performance problems?

btw.Thanks for you hard work!

jaimecbernardo commented 5 years ago

Hi @konraddysput , That's good. Thanks for letting us know.

There are no specific issues we're aware of because of express. Please let us know if you spot unusual behavior.

Thank you!

konraddysput commented 5 years ago

@jaimecbernardo should we close this topic? I think I could help you with some sort of feedback about your framework after my beta tests of my application. Just let me know if you need my help.

jaimecbernardo commented 5 years ago

It sounds good. Closing the issue. If you run into issues, please open an issue in the project's main repo. (This issue we are commenting on is in the samples repo) Thank you.