convert json into string in java code example
Example 1: how to convert jsonobject to string in java
JSONObject json = new JSONObject();
json.toString();
Example 2: convert json string to json object in java
try {
JSONObject jsonObject = new JSONObject("{\"phonetype\":\"N95\",\"cat\":\"WP\"}");
}catch (JSONException err){
Log.d("Error", err.toString());
}