List of usage examples for android.util JsonToken END_OBJECT
JsonToken END_OBJECT
To view the source code for android.util JsonToken END_OBJECT.
Click Source Link
From source file:com.thingsee.tracker.REST.KiiBucketRequestAsyncTask.java
private JSONObject readSingleData(JsonReader jsonReader) throws IOException, JSONException { JSONObject jsonObject = new JSONObject(); jsonReader.beginObject();//from www .j ava2s . co m JsonToken token; do { String name = jsonReader.nextName(); if ("sId".equals(name)) { jsonObject.put("sId", jsonReader.nextString()); } else if ("val".equals(name)) { jsonObject.put("val", jsonReader.nextDouble()); } else if ("ts".equals(name)) { jsonObject.put("ts", jsonReader.nextLong()); } else if ("_owner".equals(name)) { jsonObject.put("_owner", jsonReader.nextString()); } token = jsonReader.peek(); } while (token != null && !token.equals(JsonToken.END_OBJECT)); jsonReader.endObject(); return jsonObject; }