JSONObject to string android studio code example
Example 1: how to convert jsonobject to string in java
JSONObject json = new JSONObject();
json.toString();
Example 2: string to JSONobject android
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 + "\"");
}