Content ": {" item ": [{" category ":" xxx "}, {" category ":" yy "}}}}
How to read this structure, any For example know how to do JSN Parser
Thanks
This code will help you to parse Jason.
string jsonStr = "{\" content \ ": {\" item \ ": [{\" category \ ": \" xxx \ "}, {\" category \ ": \ "Y y \"}]}} "; {ArrayList & lt; String & gt; Categories = New Arrestists & lt; String & gt; (); JSONObject obj = new JSONObject (jsonStr); JSONObject content = obj.getJSONObject ("content"); JSONArray array = content.getJSONArray ("item"); For (int i = 0, count = array.length (); i & lt; count; i ++) {JSONObject categoty = array.getJSONObject (i); Categories.add (categoty.getString ("category")); }} Hold (JasonX Express E) {e.printStackTrace (); }
Comments
Post a Comment