【发布时间】:2018-02-08 06:42:28
【问题描述】:
在我的 Android 应用程序中,我必须根据“id”按升序对下面的 JSON 对象进行排序。将有大约 2000 个对象。请告诉我如何对这些 JSON 对象进行排序。
[
{
"id": "bitcoin",
"name": "Bitcoin",
"symbol": "BTC",
"rank": "1",
"price_usd": "8001.02",
"price_btc": "1.0",
"24h_volume_usd": "9892040000.0",
"market_cap_usd": "134838389703",
"available_supply": "16852650.0",
"total_supply": "16852650.0",
"max_supply": "21000000.0",
"percent_change_1h": "-1.27",
"percent_change_24h": "7.28",
"percent_change_7d": "-20.22",
"last_updated": "1518071364"
},
{
"id": "ethereum",
"name": "Ethereum",
"symbol": "ETH",
"rank": "2",
"price_usd": "803.952",
"price_btc": "0.100246",
"24h_volume_usd": "4216090000.0",
"market_cap_usd": "78370675159.0",
"available_supply": "97481784.0",
"total_supply": "97481784.0",
"max_supply": null,
"percent_change_1h": "-1.22",
"percent_change_24h": "7.16",
"percent_change_7d": "-29.01",
"last_updated": "1518071354"
}
]
【问题讨论】: