Answers for "string to JSONobject + android"

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 "Javascript"

Browse Popular Code Answers by Language