The above answer is not working for me.
Actually this code works, please use latest version of socket.io client version :
https://github.com/socketio/socket.io-client-java
Add this in your build.graddle :
compile ('io.socket:socket.io-client:1.0.0') {
// excluding org.json which is provided by Android
exclude group: 'org.json', module: 'json'
}
Then you can connect to your namespace with this snippet :
Socket socket;
try {
socket = IO.socket(socket_host + "/your_namespace");
} catch (URISyntaxException e) {
Log.d("ERROR :", e.toString());
}
socket.connect();
Check this github issue where there are more explanation :
https://github.com/nkzawa/socket.io-android-chat/issues/8