How to get JSON DATA in android -


I have JSON data I like this: I am a little confused in getting these JSN data.

  JSONObject jb = (JSONObject) entries .getJSONObject ("data"); Log D. ("Get value", "+ ----" + jb.length ()); // Here I have 6 lengths for I (int i = 0; i & lt; jb.length (); i ++) {JSONObject postListObj = jb.getJSONObject ("1"); String title = Postlist obz.gate string ("title"); Namelist.add (title); }  

If I JSONObject postListObj = jb.getJSONObject ("1"); Then get all the data in the list, but this is not my method. I have to get in the list of all titles in the JSON Data 2 of the User ID.

JSON Data

  {"get": [], "post": {"event": "datasource", "user_id": "" "," Data ": {" 3 ": {" ID ": 1," title ":" A "}," 4 ": {" id ": 2," title ":" b "}, "5": {"id": 5, "title": "X"}, "6": {"ID": 1172, "title" "": "" "" "":: "," title " : "Junk": "," "title": "cx"}, "8": {"id": 8, "title": "z"}}}  

How to get it and I want to store in the list id and title. My main intentions display these titles in the list and if I click cx then click on the ID to display it on toast for the removal of it. (Click on the list item posted on the Web.)

To parse Android JSON For clean and average utilities, this basically falls below all and if you want to parse a given JSON-String.


Comments