質問

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.

役に立ちましたか?

解決

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top