Remove the slashes:
String json = {"phonetype":"N95","cat":"WP"};
try {
JSONObject obj = new JSONObject(json);
Log.d("My App", obj.toString());
} catch (Throwable t) {
Log.e("My App", "Could not parse malformed JSON: \"" + json + "\"");
}
More Related Contents:
- JSON parsing in android
- JSON parsing in fragmant [closed]
- How to get values from JSON Array which doesn’t follow “key” : “value” standard / JSON with no Key?
- Android-change cardview background color parsing json
- How to create custom GsonConverter from following response?
- I am trying to parse a data from the following link
- How do i parse json object and json array in android? [duplicate]
- How to parse this? [closed]
- Sending and Parsing JSON Objects in Android [closed]
- How to send a JSON object over Request with Android?
- Determine whether JSON is a JSONObject or JSONArray
- org.json.JSON Exception : End of input at character 0
- OkHttp Post Body as JSON
- Populate Listview from JSON
- convert ArrayList to JSONArray
- How to parse this nested JSON array in android
- how to send json object to server using volley in android
- Parse JSON array response using Retrofit & Gson
- Retrofit2.0 gets MalformedJsonException while the json seems correct?
- How to implement autocompletetextview with listview?
- Using JSON File in Android App Resources
- Value
- How to get response as String using retrofit without using GSON or any other library in android [duplicate]
- Getting Header from Response (Retrofit / OkHttp Client)
- Cannot deserialize instance of object out of START_ARRAY token in Spring Webservice
- How can Retrofit 2.0 parse nested JSON object?
- How to Draw Route in Google Maps API V2 from my location [duplicate]
- java.lang.BootstrapMethodError: Exception from call site #4 bootstrap method ,when initializing Retrofit
- org.json.simple.JSONObject cannot be cast to org.json.JSONObject
- Parsing dynamic JSON in Android