update README
This commit is contained in:
@@ -32,19 +32,19 @@ socket.on(Socket.EVENT_CONNECT, new Emitter.Listener() {
|
|||||||
socket.connect();
|
socket.connect();
|
||||||
```
|
```
|
||||||
|
|
||||||
This Library uses [Gson](https://code.google.com/p/google-gson/) to parse and compose JSON strings:
|
This Library uses [org.json](http://www.json.org/java/) to parse and compose JSON strings:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
// Sending an object
|
// Sending an object
|
||||||
JsonObject obj = new JsonObject();
|
JSONObject obj = new JSONObject();
|
||||||
obj.addProperty("hello", "server");
|
obj.put("hello", "server");
|
||||||
socket.emit("foo", obj);
|
socket.emit("foo", obj);
|
||||||
|
|
||||||
// Receiving an object
|
// Receiving an object
|
||||||
socket.on("foo", new Emitter.Listener() {
|
socket.on("foo", new Emitter.Listener() {
|
||||||
@Override
|
@Override
|
||||||
public void call(Object... args) {
|
public void call(Object... args) {
|
||||||
JsonObject obj = (JsonObject)args[0];
|
JSONObject obj = (JSONObject)args[0];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user