Using org.json library:
try {
JSONObject jsonObject = new JSONObject("{\"phonetype\":\"N95\",\"cat\":\"WP\"}");
}catch (JSONException err){
Log.d("Error", err.toString());
}
More Related Contents:
- “Expected BEGIN_OBJECT but was STRING at line 1 column 1”
- Convert JSON to Map
- JSON Array iteration in Android/Java
- how to parse JSONArray in android
- Difference between JSONObject and JSONArray
- How to Parse JSON Array with Gson
- Accessing members of items in a JSONArray with Java
- How to create correct JSONArray in Java using JSONObject
- Do JSON keys need to be unique? [duplicate]
- How to parse JSON Array (Not Json Object) in Android
- How to read json file into java with simple JSON library
- Parsing JSON in Java without knowing JSON format
- How to decode JSON with unknown field using Gson?
- Parsing JSON string in Java
- Parse JSON file using GSON
- Parsing JSON Array within JSON Object
- Add JsonArray to JsonObject
- How to convert JSONObjects to JSONArray?
- Creating nested JSON object for the following structure in Java using JSONObject? [closed]
- How do I remove a specific element from a JSONArray?
- How to parse a JSON string into JsonNode in Jackson?
- How to access nested elements of json object using getJSONArray method
- JSON parsing to Java – Android application
- Parse JSON from HttpURLConnection object
- Parsing nested JSON data using GSON
- How to convert JSONArray to List with Gson?
- Using gson to deserialize specific JSON field of an object
- How to convert HashMap to json Array in android?
- Retrieving values from nested JSON Object
- How can I turn a JSONArray into a JSONObject?