java - Connect Socket Android and join group -
i'm trying connect android's app server socket when don't know how can subscribe group. i'm using websocketclient (import org.java_websocket.client.websocketclient;) , receive message connected.
the next step subscribe group receive 1 or information can't this. hope can me.
thanks!
uri uri; try { uri = new uri(url); } catch (urisyntaxexception e) { e.printstacktrace(); return; } mwebsocketclient = new websocketclient(uri) { @override public void onopen(serverhandshake serverhandshake) { toast.maketext(showparking.this, "open", toast.length_short).show(); } @override public void onmessage(string s) { final string message = s; runonuithread(new runnable() { @override public void run() { toast.maketext(showparking.this, message, toast.length_short).show(); toast.maketext(showparking.this, mwebsocketclient.getreadystate().tostring(), toast.length_short).show(); } }); } @override public void onclose(int i, string s, boolean b) { toast.maketext(showparking.this, "close", toast.length_short).show(); } @override public void onerror(exception e) { } }; mwebsocketclient.connect(); toast.maketext(showparking.this, "conecto", toast.length_short).show();
Comments
Post a Comment