Dray Dray - 1 year ago 97
Android Question

Getting String Value from Json Object Android

I am Begineer in Android.In my Project, I am getting the Following json from the HTTP Response.

[{"Date":"2012-1-4T00:00:00","keywords":null,"NeededString":"this is the sample string I am needed for my project","others":"not needed"}]

I want to get the "NeededString" from the above json.How to get it.

Answer Source

This might help you.

JSONArray arr = new JSONArray(result);
JSONObject jObj = arr.getJSONObject(0);
String date = jObj.getString("NeededString");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download