Created
December 30, 2014 02:46
-
-
Save ColdSauce/ee29268f3db25cef6bc1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SocketIOClient.connect(AsyncHttpClient.getDefaultInstance(), "http://192.168.1.2:3000", new ConnectCallback() { | |
@Override | |
public void onConnectCompleted(Exception ex, SocketIOClient client) { | |
if (ex != null) { | |
ex.printStackTrace(); | |
return; | |
} | |
client.setStringCallback(new StringCallback() { | |
@Override | |
public void onString(String string) { | |
System.out.println(string); | |
} | |
}); | |
client.on("someEvent", new EventCallback() { | |
@Override | |
public void onEvent(JSONArray argument, Acknowledge acknowledge) { | |
System.out.println("args: " + arguments.toString()); | |
} | |
}); | |
client.setJSONCallback(new JSONCallback() { | |
@Override | |
public void onJSON(JSONObject json) { | |
System.out.println("json: " + json.toString()); | |
} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment