Organizational Research By

Surprising Reserch Topic

which websocket library to use in android app

which websocket library to use in android app  using -'android,node.js,websocket'

I want to add a Service to my Android app which runs in the background holding a WebSocket connection (possibly over several hours or even days) and regularly sends some data to a server.

Now there seems to be a bunch of WebSocket libraries for Java, and I'm not sure which one I should use:

Description from GitHub: A barebones WebSocket client and server implementation written in 100% Java.
-- This one is linked in my first result of googling "android websocket". However, it has quite a few open issues, especially about SSL connections, and it doesn't seem to be actively maintained at the moment.
Description from GitHub: Asynchronous socket, http (client+server), websocket, and library for android. Based on nio, not threads.
-- Again many open issues, but seems to be activiley maintained/worked on.
Project Tyrus
Description from Website: JSR 356: Java API for WebSocket - Reference Implementation
-- This is made by Oracle. Not sure if it works in Android.
Jetty WebSocket Client API
Info from Website: Jetty also provides a Jetty WebSocket Client Library to write make talking to WebSocket servers easier.
-- Again: Not sure if it works in Android.
Description from GitHub: Bare minimum websockets (hybi13/RFC) client for Android
-- This one is used in schwiz/android-websocket-example, which is the accepted answer for the StackOverflow-question "How to make the Android device hold a TCP connection to Internet without wake lock?".
Description from GitHub:  WebSockets with fallback transports client library for Node.js, Android and Java
Description from GitHub: High-quality WebSocket client implementation in Java.
Description from GitHub: An HTTP+SPDY client for Android and Java applications.
-- It has a Websocket module.

In addition, there is a native client library for Android:

Description from GitHub: Full-featured Socket.IO Client Library for Java, which is compatible with Socket.IO v1.0 and later.

To use the Android client would be handy for me, because I plan to use nodejs/ for the web frontend anyway. But the native client is quite young and has several open issues. And in addition to that, it is my understanding that an android app does not have any benefit of using the client library (apart from being compatible with 1.0 server), because WebSocket support can be assured at the client side.

My requirements are as follows:

Compatibility with Android API 9 and higher
Possibility to connect via SSL
Keep the connection for a long time without having to hold a permanent wakelock
Compatibility with an available nodejs websocket server implementation or with

Any suggestions which one is the right library for these requirements?
asked Sep 18, 2015 by balvant maurya
0 votes

Related Hot Questions

Government Jobs Opening