Issue
So I know this has been questioned quite a lot. To be exact for example in these questions:
Every option presented has a problem though:
I want to run it on my normal device so I would like to avoid installing another OS on my Device
Work on JXCore was stopped last month and (maybe as a result) I couldn't get it to compile (see Can't install jxcore-cordova)
- The Android Port of NodeJs Anode has not been worked on since 2014 and wasn't really maintained back then anyways
- The second answer in the second thread I linked to mentioned there is an official node distribution for Android now but apart from a link to the Browse-Website of the latest dist I couldn't find any info on how to actually use it
- I also saw this but it seems like the device has to be connected to a PC (or similar) to run the adb shell commands while I would like to make it as a separate App
With the time that past since these questions have been posted and as the "best option" JXCore seem to be now unusable:
Is there a way to run a node.js application (a server in my case) on an Android device?
if you're wondering why I'd want this: I made a WebApp with a Node.Js server and I now want a version you can launch locally from your phone without requiring an Internet connection. This means the server needs to run on an Android phone.
Solution
I just had a jaw-drop moment - Termux allows you to install NodeJS on an Android device!
It seems to work for a basic Websocket Speed Test I had on hand. The http served by it can be accessed both locally and on the network.
There is a medium post that explains the installation process
Basically: 1. Install termux 2. apt install nodejs 3. node it up!
One restriction I've run into - it seems the shared folders don't have the necessary permissions to install modules. It might just be a file permission thing. The private app storage works just fine.
Answered By - Pyro
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.