0
2個陣列我需要解析下面JSON:解析JSON與Android中
{
"this_year_ti": "TYMN01",
"last_year_ti": "LYMN01",
"this_year": [
{
"date": "20140310 14:20:10",
"amount": 5.2,
"usage": 3.2,
"ratio": 1
},
{
"date": "20140310 14:20:10",
"amount": 5.2,
"usage": 3.2,
"ratio": 1
}
],
"last_year": [
{
"date": "20130310 15:20:10",
"amount": 6.87,
"usage": 4.2,
"ratio": 2
},
{
"date": "20130310 15:20:10",
"amount": 6.87,
"usage": 4.2,
"ratio": 2
}
]
}
即:將JSON包含:2個元素( 「this_year_ti」 和 「last_year_ti」)和2門陣列( 「THIS_YEAR」和「last_year」)。
我如何解析它到一個有2個字符串和2個列表的對象A?
請幫我解決這個難題。
[GOOGLE-GSON](https://code.google.com/p/google-gson/)可以提供幫助。 –
請閱讀此:http://stackoverflow.com/questions/443499/json-to-map –
你試過的東西,直到。 – Yugesh