Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Combining java and nodejs for android app

I'm working on Android game which is turn based, and I've chosen Nodejs for the server side. I've been exploring for about two weeks how to communicate from the Android client side to the Nodejs server. Is there any way to communicate between the two.

Kindly help me if any one have any experience with such a project.

like image 253
user1645969 Avatar asked Sep 17 '12 05:09

user1645969


People also ask

Can Java and NodeJS work together?

You can intergrate NodeJS with Java using node-java.

Can we use NodeJS as backend with Android app?

You cannot run Node. js on Android, as these are unrelated things. Node. js runs on the server, while Android is the operating system.

Can I build Android app with node js?

Android JS framework lets you write android applications using JavaScript, HTML and CSS or React Native with Node. js support.

Can NodeJS be used for mobile app development?

The power of Node. js into mobile applications. Its core component is a library - available for Android and iOS - that lets you add a Node. js background worker to any mobile app. It also includes plugins for React Native and Cordova.


1 Answers

There are lots of options for something like this depending on what your game requires for communicating between client and server. For instance looking up "TCP clients for android" here shows up answers like this. If fast updates are important between server and client then UDP is one option, if your game can cope with the loss of some packets in the middle.

Besides TCP/UDP you also have things like WebSockets for Android.

like image 141
arunkumar Avatar answered Oct 20 '22 14:10

arunkumar