Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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 + """);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #string #JSONobject #android
ADD COMMENT
Topic
Name
4+7 =