Answers for "object to json string android"

1

object to json string android

Gson gson = new Gson();
String json = gson.toJson(myObj);
Posted by: Guest on May-04-2020
1

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 + "\"");
}
Posted by: Guest on May-03-2020

Code answers related to "object to json string android"

Code answers related to "Javascript"

Browse Popular Code Answers by Language