NodeJS on iOS / Android

Perhaps what I'm going to ask is stupid, as a rule, I don't have that kind of server-side experience.

I am building an Angular web application, with nodeJS on the server side.

I need the server (Node.exe) to be installed on the device itself (IOS / Android), and nodeJS will open the localhost socket to communicate with the device.

(According to the JS host official website , nodeJS only supports Windows / Mac OS / Linux)

Is it possible to do this?

If not, can I install another server on the device?

0
android angularjs ios server
Mar 19 '15 at 13:02
source share
4 answers

What you are trying to achieve turns your device into a server.

The server language on the server must remain on the server. I really don't understand why you need to open the localhost socket on the device to communicate with itself. Is it for offline testing? You can do this because you have a computer and a device, and both are connected to the same network. I believe that understanding the concept of Client-Server architecture in the first place would be a really good start.

But, in short, the appropriate way to implement the Client-Server application using the technologies you have chosen would be: The server must provide the client with answers to its requests. So in Node.js (server side) write everything you want to contact your database (create, read, update, delete), do user processing, etc ... and return a structured answer.

The client expects responses to its requests and must process the responses in code. Thus, a program written in AngularJS (which is your client-side language) will be installed on the devices.

The client must know the server response format. Is this plain text? XML? JSON? ...

+1
Mar 19 '15 at 13:51
source share

I do not understand how to use the server tool on the client side.

If your application should work offline, you must put all the data and other into your client application (using the cord).

If your application runs online, the server side is needed to service your data. Here you can configure the nodeJS API, which provides routes for your application to print content.

I'm not sure I gave you the desired answer, so what can explain how to use the server tool on the client device?

0
Mar 19 '15 at 13:14
source share

Yes, you can with JXCore (fork nodejs), more information in this link www.huffingtonpost.com/brian-rinaldi/build-mobile-apps-with-ja_b_6786920.html repository is here: www.huffingtonpost.com/brian-rinaldi /build-mobile-apps-with-ja_b_6786920.html and how to compile it here. github.com/jxcore/jxcore/blob/master/doc/HOW_TO_COMPILE.md

but if you need it to be nodejs (and not the latest version), you can use this link to do what you need www.goland.org/nodejsonandroid/

0
Apr 01 '15 at 20:00
source share

do you want the application to be able to run some services via http?

not sure if iOS allows the application to use a JS virtual machine ...

and for android
search on Github and I find how to build NodeJS for Android https://github.com/dna2github/dna2oslab/tree/master/android/build

Here is an example of running a compiled Nginx binary on Android at https://github.com/dna2github/dna2mtgol/tree/master/fileShare

You can change a bit more to replace Nginx with NodeJS. The code to run Nginx is not very nice; perhaps you can try the Android service so that the server runs on the backend on the Android device.

Hope this is what you want.

0
Nov 20 '16 at 14:23
source share



All Articles