Question

I am trying to use a socket.io https://github.com/koush/AndroidAsync#androidasync-also-supports-socketiolibrary lib and trying to send a string using webSocket.send("a string"); by creating a new web socket using AsyncHttpClient. and sending string through String callback. but it is not working ?

webSocket.setStringCallback(new WebSocket.StringCallback() {
                    public void onStringAvailable(String s) {
                        System.out.println("I got a string: " + s);
                    }
                });

can any one tell me the right usage of it because ReadMe.txt not updated.

Was it helpful?

Solution

I'm not sure which socket.io android library you're using, but you might want to have a look at socket.io-java-client which is fully android supported

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top