我最近開始使用andorid。Android從php解析JSON與多個數組響應
如何解析動態json與PHP服務器的多個數組響應。
登錄響應與錯誤消息
{
"status": 0,
"data": "No users found with given email."
}
和另一個
庫存清單
{
"status": 1,
"data": {
"msg": "LoggedIn",
"user_id": "2"
}
}
登錄響應
{
"status": 1,
"data": [
{
"inventory_id": "33",
"apron_id": "123456",
"nickname": "uyi",
"location": "13",
"manufacture": "0",
"garment_type": "yuyh",
"color": "juki",
"core_material": "ytyt",
"Date_purchase": "2015-04-10",
"UID_no": "ikujki",
"serial": "iui",
"Batch": "ikk",
"Expiration": "2015-04-23",
"QTY": "898",
"apron_status": "0",
"apron_retire": "0",
"created_user": "2",
"created_time": "2015-04-10 05:22:38",
"update_time": "2015-04-10 05:22:38"
},
{
"inventory_id": "32",
"apron_id": "12345mn",
"nickname": "gfhgh",
"location": "12",
"manufacture": "0",
"garment_type": "hgjyhj",
"color": "ytgtfghtg",
"core_material": "fhgfhy",
"Date_purchase": "2015-04-28",
"UID_no": "rtryttttttttt",
"serial": "hfh",
"Batch": "rtrrtyy",
"Expiration": "2015-03-17",
"QTY": "7688",
"apron_status": "0",
"apron_retire": "0",
"created_user": "2",
"created_time": "2015-04-10 05:15:54",
"update_time": "2015-04-10 05:15:54"
}
]
}
在此先感謝。
http://www.androidhive.info/2012/01/android -json-parsing-tutorial/ –
你試過了什麼? – micky
是的教程是明確的謝謝@MdAbdulGafur –