在Android中运行NodeJs服务器 [英] Run NodeJs server in Android
问题描述
是否可以在android设备(例如linux设备而不是android应用)中运行NodeJs服务器.
Is it possible to run NodeJs server in android device (like linux devices not android apps).
如果可能,请帮助我.
是否可以在Android设备上启动mongo服务器?
And is it possible to start mongo server on Android device?
我的设备:
- RK3288电视盒(android 4)
- 华硕fonepad 7(Android 5操作系统)
- LG Optimus G(Android 4根)
重要!!我想在android中启动服务器应用程序.因为我有一个未使用的android TV-Box,我想在我的家庭服务器中使用它
Important!! I want to start a server app in android. because I have an unused android TV-Box and I want to use it in my home server
而且我不想在APK文件中使用它(以将HTML文件加载到WebView中).我需要nodejs服务器而不是具有CommonJs和RequireJs的javascript客户端
And I don't want to use it in APK files (to load html files in WebView s). I need nodejs server not javascript client with CommonJs and RequireJs
推荐答案
您可能希望在android设备上安装chrooted-linux,如
You might want to install a chrooted-linux on your android-device, as explained here.
简而言之,请执行以下操作:
In short, do this:
- 准备linux-image
- prepare linux-image
- 在任何gnu + linux -device上执行此操作.
- 创建一个大文件(> 1 GB)
- 将其格式化为文件系统(例如ext2)
- 安装.
- 复制其中的发行版(例如,使用debootstrap)
- 也许安装busybox
- 将某些目录从根设备附加到主机(通常是
dev
,dev/pts
,proc
和sys
)
- maybe install busybox
- attach some directories from the root-device to the host (usually
dev
,dev/pts
,proc
andsys
)
注意:我做过类似于tf301的事情,它的工作原理很吸引人.但是当我开始在chroot中使用过多的内存时(例如在编译android-app时),主机将崩溃.我还没有遇到过节点崩溃的情况,我也不知道其他设备是否受此影响.
note: I have done something similar to my tf301 and it works like a charm. But when I start to use too much memory inside the chroot (e.g. when compiling an android-app), the host will crash. I have not yet experienced those crashes with node and I do not know, if other devices are affected by this.
这篇关于在Android中运行NodeJs服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!