好吧,我已經通過了大量關於PARSing JSON結果的示例,但沒有運氣。我有下面的JSON示例,我現在不想要狀態信息或geoLocation。我只想使用工作站對象,並從數組中選擇一些東西作爲列表顯示在我的ListView中。我不明白那裏的任何文件。PARSING JSON到ListView
有人能夠提供一個關於如何讀取JSON並將其放入ListView的簡單示例。這將非常有幫助。我沒有編寫任何代碼,因爲它們都不適合我。
{
"status": {
"error": "NO",
"code": 200,
"description": "none",
"message": "Request ok"
},
"geoLocation": {
"city_id": "147",
"city_long": "Saint-Laurent",
"region_short": "QC",
"region_long": "Quebec",
"country_long": "Canada",
"country_id": "43",
"region_id": "35"
},
"stations": [
{
"country": "Canada",
"reg_price": "N\/A",
"mid_price": "N\/A",
"pre_price": "N\/A",
"diesel_price": "N\/A",
"address": "3885, Boulevard de la C\u00f4te-Vertu",
"diesel": "0",
"id": "33862",
"lat": "45.492367",
"lng": "-73.710915",
"station": "Shell",
"logo": "http:\/\/www.mygasfeed.com\/img\/station-logo\/logo-shell.png",
"region": "Quebec",
"city": "Saint-Laurent",
"reg_date": "N\/A",
"mid_date": "N\/A",
"pre_date": "N\/A",
"diesel_date": "N\/A",
"distance": "1.9km"
}
]
我知道這是舊的,但如果任何人正在尋找一個教程來解析JSON到自定義ListView這裏是一個教程:http://ecetechprojects.wordpress.com/2014/02/26/android-complete-json-to-listview-tutorial/ – 2014-02-26 21:38:12