Best code examples for Android JsonReader class (android.util.JsonReader)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android JsonReader class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android JsonReader examples from Open Source projects
This code example shows how to use the following methods: beginArray, close, endArray, hasNext, nextString
        String jsonText = JavaScriptUtils.executeJavaScriptAndWaitForResult(
                view, viewClient, sb.toString());
        Assert.assertFalse("Failed to retrieve contents for " + nodeId,
                jsonText.trim().equalsIgnoreCase("null"));
 
        JsonReader jsonReader = new JsonReader(new StringReader(jsonText));
        String value = null;
        try { 
            jsonReader.beginArray();
            if (jsonReader.hasNext()) value = jsonReader.nextString();
            jsonReader.endArray();
            Assert.assertNotNull("Invalid contents returned.", value);
 
            jsonReader.close();
        } catch (IOException exception) {
            Assert.fail("Failed to evaluate JavaScript: " + jsonText + "\n" + exception);
        } 
        return value;
    } 
 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: beginObject, endObject, setLenient
	} 
 
	private boolean processInput(InputStream in) {
		JsonReader jr;
		try { 
			jr = new JsonReader(new BufferedReader(new InputStreamReader(in,
					"UTF-8"))); 
 
			jr.setLenient(true);
			jr.beginObject();
 
			/* Read ReturnCode */ 
			Pair<String, Boolean> pair = AdminHelper
					.handleResponse(JsonCustomReader.readJSONRetCode(jr, in));
 
			if (!pair.getSecond()) {
				errorMessage = pair.getFirst();
				return false; 
			} 
		 

6
CodeRank
This code example shows how to use the following methods: beginObject, endObject, setLenient
	} 
	 
	private boolean processInput(InputStream in){
		JsonReader jr;
		try { 
			jr = new JsonReader(new BufferedReader(new InputStreamReader(
					in, "UTF-8")));
 
			jr.setLenient(true);
			jr.beginObject();
 
			/* Read ReturnCode */ 
			Pair<String, Boolean> pair = AdminHelper
					.handleResponse(JsonCustomReader 
							.readJSONRetCode(jr, in));
			 
			if (!pair.getSecond()) {
				errorMessage = pair.getFirst();
				Log.v(TAG, "No Details found.");
				return false;  

6
CodeRank
This code example shows how to use the following methods: beginObject, setLenient
		 
		private boolean processInput(InputStream in) {
			 
			JsonReader jr;
			try { 
				jr = new JsonReader(new BufferedReader(new InputStreamReader(
						in, "UTF-8")));
 
				jr.setLenient(true);
				jr.beginObject();
 
				/* Read ReturnCode */ 
				Pair<String, Boolean> pair = AdminHelper
						.handleResponse(JsonCustomReader 
								.readJSONRetCode(jr, in));
 
				errorMessage = pair.getFirst();
				return pair.getSecond();
				 
			} catch (UnsupportedEncodingException e) {
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods:
 
	public JsonReader nodeGet(int nid, String fields)
			throws ServiceNotAvailableException, ClientProtocolException, 
			IOException { 
		String uri = mENDPOIN + "node/" + nid;
		JsonReader jsr = new JsonReader(callGet(uri));
		return jsr;
	} 
 
	public JsonReader taxonomyVocabGetTree(int vid)
			throws ServiceNotAvailableException, ClientProtocolException, 
			IOException { 
		return taxonomyVocabGetTree(vid, 0, 0);
	} 
 
	public JsonReader taxonomyVocabGetTree(int vid, int parent, int maxdepth)
			throws ServiceNotAvailableException, ClientProtocolException, 
			IOException { 
		String uri = mENDPOIN + "taxonomy_vocabulary/getTree";
		int size = 2;
Full Snippet Info
5
CodeRank
Related Android JsonReader Questions & Answers:
See Code Examples for Android JsonReader Methods: