Android to node.js communication Android to node.js communication android android

Android to node.js communication


I'm the author of node-websocket-server (nws), and I'm pretty sure the reason for node-websocket-server working and socket.io not, is due to the implementation of each. NWS will auto negotiate the right draft to use, and it also has a hopefully 90-100% compliance with the drafts of 76 and 75.

As for socket.io, I can't comment too much, but the last I looked, it's websocket implementation was rather poorly implemented.

I'm currently working on a project at the moment called node-websocket-protocol, which will be able to be used by socket.io, faye, etc as to provide them with a really reliable and compliant websocket implementation. This will also replace the current implementation in node-websocket-server in version 2.0.0.

As a side note, if you'd rather not host your own websocket server, you could look at using Pusher.com, who're actually my employers.

[Update] As for whether websockets are the most appropriate technology choice for your application, is a matter of what type of data and interaction your application needs. On a mobile device, it may be best to use something like urbanairship or notifio if you're just sending push notifications.

Regards,Micheil Smith


Like Raynos said the websocket spec is still a draft(changes). Maybe you could ask Guillermo Rauch(Author socket.io) which draft he is using and find the proper Websocket library. At his github page you can find his email address and try to send him an email(short).

You could also try to use another transport(long-polling) and implement the spec yourself I guess.

But in my opinion you should be using Google's c2dm(Big players are already using this and will be very gently to your phone's battery) instead to push updates to phone in realtime. I already have a lot of applications installed that are using c2dm like for example whatsapp(awesome). You could be using notifo's api to simplify your work. Then simply install there android program to receive the desired notifications. There is also a node module(npm) available for you to use (easy :))


I recommend