JSON object to listView
Solution 1
Look at these two tutorials, In these Json object are displayed in Custom ListView, I think this is what you needed,
Android Putting Custom Objects in ListView
Solution 2
For simple example no need of custom list view. you can work with simple list view.
- Parse the JSON data retrieve the data
- store them in a list and pass that list as an argument to the adapter
- set the adapter to the list view.
ashutosh
Updated on June 04, 2022Comments
-
ashutosh almost 2 years
i am newbie to android, I wanted to implement dynamically JSON data to my android listView, I have only to objects in JSON file this are dealname and discount.
I checked all questions and tutorials but when i implemented those codes in application, neither one is running. I just wanted to ask, to implement such JSON data, should i need to parse data and convert into String array so simple listview work, or i need to implement custom listview? Plz your suggestions will help to solve this assignment..
Thanks in advance.
-
MKJParekh over 12 yearsyou need to parse the json data into simple array and then set that array to adapter.
-
MKJParekh over 12 yearsmore see this tutorial mobile.dzone.com/news/android-tutorial-how-parse and if finding more than 1 field in a json object see this to add multiple object to listview josecgomez.com/2010/05/03/…
-
-
ashutosh over 12 yearsFrankenstein and user370305 thanks for ur suggestions... It will help me alot.. Thank u very much...
-
theblang over 10 yearsSecond link is expired.
-
hichris123 about 10 yearsWhile this answer may theoretically answer the question, it is better to include the essential parts of the answer here, and provide the link for reference.