I have a python library that I want to use for the core logic of an Android and iOS app. One solution would be to put the python logic into a server and interact with my app through HTTP. If the server is remote though, the user will have to remain online to use the app. Is there anyway I can embed a HTTP server within the apps so that the user doesn't have to be online?
Maybe what I'm about to ask is stupid, generally I don't have so experience with server-side.
I'm building an Angular web application, with nodeJS on the server-side.
I need that the server (Node.exe) will installed in the device itself (IOS/Android), and nodeJS will open a localhost socket to communicate with the device.
(According to nodeJS official web site, nodeJS only support windows/Mac OS/Linux)
It's possible to do that?
If not, there is another server can I install in the device?
Yes you can with JXCore (a fork of nodejs), more info in this link
Build Mobile Apps with JavaScript and the Node.js Ecosystem repository is in here.
And how to compile it is in here JXCore - How to Compile
But if you need it to be nodejs (not the last version) you can use this link to do what you need Building and running Node.js for Android
UPDATED 27-09-2018
Like someone has pointed out, that project is no longer maintained but I have found and alternative by Using Termux on an Android phone you can use nodejs / gcc / vim / etc and more tools to do many thing
This link show how to do it for nodejs ( and I have tested it on my phone ):
Building a Node.js application on Android - Part 1: Termux, Vim and Node.js
First install termux from playstore, of course.
I don't understand the point of using a server tool on the client side.
If your application should work with an offline mode, you should put all data and other in your client app (using cordova).
If your application works with an online mode the server side is needed to serve your data. Here you can setup a nodeJS API which provides routes for your application to have content to print.
I'm not sure I brought you the wanted answer, so can explain more the point of using a server tool on a client device?
What you are trying to achieve, turns your device into a server.
A server side language is meant to stay on the server.
I don't really see why you need to open a localhost socket on the device to communicate with itself. Is it for offline testing? You can do that since you have a computer and a device, and both are connected to the same network.
I believe a really good start would be understanding the concept of the Client-Server architecture first.
But in short, the proper way of implementing a Client-Server app using your chosen technologies would be:
A server should provide the client with answers to his requests.
So in Node.js (server-side), write whatever you want to communicate with your database (Create, Read, Update, Delete), do custom processing, etc...
and return a structured answer.
The client is expecting answers to his requests, and is supposed to handle the answers in code. So the program written in AngularJS (which is your client-side language) will be installed on devices.
The client has to know the format of the server's answer. Is it plain text? XML? JSON? ...
so you mean you would like to have an app can run some services via http?
not sure if iOS allows application with JS virtual machine executing code ...
and for Android
searching on Github and I find how to build NodeJS for Android
https://github.com/dna2github/dna2oslab/tree/master/android/build
Here is an example to run compiled Nginx binary on Android at https://github.com/dna2github/dna2mtgol/tree/master/fileShare
You may modify a little more to replace Nginx to NodeJS. The code to run Nginx is not very nice; maybe you can try an Android Service to let the server run on backend on Android device.
Hope it is what you want.
I have visited many blogs and questions looking for a way to use android as a client and nodejs as a server for my app. I came up with a solution that is to use PhoneGap like frameworks so that it could act like native but is not in reality. I need to use native android sdk and connect with NodeJS server (using SocketIO) to create my app. Is there any way I could do this?
P.S I want to know that while I set up by GCM can I pass my IP and port that I have created in my socket.io file to the GCM?
Cordova (hence PhoneGap) allows you to use most of the hardware APIs. PhoneGap nowadays is just a build service of some sorts.
The Cordova website and plugin store explain all the details. But t WebSockets are just an upgraded protocol or feature of TCP. Any newer technology supports it without any dependencies, but in dependence of the network you're traveling in.
Without diving deep into the code here at socket.io-website, I reckon that the initial build of your Cordova app is a WebSocket implementation to the server. So you got everything bootstrapped already.
What this tutorial doesn't explain is how to connect to the server. But read it up here.
I have no prior experience but Google Cloud Messaging seems not to be in the scope of the problem of socket.io. Once you have a connection to the socket you can send to the client whatever payload you want and might or might not need GCM anymore. If you need to send stuff via GCM read up on the the GCM node module.
Passing IPs around shouldn't be much of a problem since you're are running a public service anyway. You'd need to secure it anyhow of course.
I have a GWT App deployed on Google App Engine that makes use of RPC Calls to function.It uses Bigquery Cloud as a backend for database operations.How can i create an android app from existing google app or do i have to code again to build a native android app for this application.
You can use a combination of mgwt and GWT-Phonegap to create apps for Android and iOS.
if RPC is your problem, you can use GWT-P REST to change your RPC in REST-FULL service. You need to refactoring your GWT client code and Server code. I had ever use in project GWT-P rest with an SPRING-REST on server side, that's work well. This can solve the problem's of RPC and serialization policy from GWT.
If you want to use the client code from gwt and use this in android Application, your only choice is to use phonegap and MGWT to create responsive design, but you must separate you server code and client code in three differents module with maven (client - server - DTO).
In first if i was at your place, i will transform my RPC service in REST-FULL service.
After if your application is only to android and not too complexe, i advise to create an Native App android. MGWT + PHONEGAP + GWTP is more to create mobile cross-platform application.
is it possible chat android to IOS using wifi in same network?
if yes,give sample code available for the same. I previously checked for bluetooth chat but it is not possible so now I look on wifi chat help please.
Alljoyn is c++ based library to build up bus connection for two or more devices. You can build up multiplayer game, chat messaging . - https://www.alljoyn.org/
If you would like to make it global ( I mean TCPIP based which i used Node.js is suitable for your project )
You do not get in to deep level. Node.js is here for help developers to build http level socket stream . I builded my own app android and ios with using Node.js client. And server part socket.io library will be handle messaging tail and also with database driver