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. http://java-websocket.org/
-- 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 socket.io library for android. Based on nio, not threads.
-- Again many open issues, but seems to be activiley maintained/worked on.
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 http://async-io.org
Description from GitHub: High-quality WebSocket client implementation in Java.
Description from GitHub: An HTTP+SPDY client for Android and Java applications. http://square.github.io/okhttp/
-- It has a Websocket module.
In addition, there is a native socket.io 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 socket.io Android client would be handy for me, because I plan to use nodejs/socket.io 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 socket.io client library (apart from being compatible with socket.io 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 socket.io
Any suggestions which one is the right library for these requirements?