10

I have a Node.js app that uses HTTP / REST (using Express.js), and a native Android application that communicates with this. This works fine.

I am now looking at writing a more real-time version, which can push messages to a native client. Unfortunately, it needs to be a native client, as there is some fairly complex work done with the data that simply will not be possible in a mobile browser for the forseable future (otherwise I would just wait for WebSockets support to appear in the Android browser).

So, my question is what are my options?

I know about the Android Cloud to Device Messaging framework, but this requires registration and a Google sign-in, and I would much prefer the server to be client agnostic.

Is there a reliable WebSocket client that I can use (ideally) to talk to a Node.js server running Socket.io? Or any other native method (using the NIO classes)?

backtick
  • 101
  • 1
  • 3

3 Answers3

5

you could use https://github.com/koush/android-websockets. It is also mentioned in the socket.io wiki pages

PS: i know it is a bit late to respond to this post, but this for other like me who didn't find an answer to question like this.

Avinash R
  • 3,101
  • 1
  • 27
  • 47
5

See Java socket.io client

Community
  • 1
  • 1
Femi
  • 64,273
  • 8
  • 118
  • 148
0
compile node.js on Android natively
    implement jni wrapper of node.js
    ...

refer this link

https://github.com/paddybyers/anode/issues/15

Ruban
  • 1,514
  • 2
  • 14
  • 21