我正在尝试将 fusiontables sql 响应放入 android 中的 sqlite db。jsonlint.com 说该对象是有效的 JSON。但是,“行”中的数组不被识别为 JsonArrays 或 JSONArrays。sql 响应中的行数可能会有所不同。示例响应如下。我将不胜感激任何帮助为我指出正确的解决方案方向。甚至帮助我提出一个更好的问题。我难住了!
{
"columns":"[Text, Number, Location, Date, ma, mb, mc, md, me, mf, mg, mh, mi, Xtid, JTid]",
"kind":"fusiontables#sqlresponse",
"rows":"[
[Text, 1.0, 33.2, -81.2, 2013-04-29T20:34:31.518-04:00, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 100.0],
[Text, 3.0, 33.2, -81.2, 2013-04-29T20:43:43.257-04:00, 24.0, 23.0, 18.0, 19.0, 54.0, 21.0, 31.0, 45.0, 32.0, 29.7, 58.1],
[Text, 5.0, 33.2, -81.2, 2013-05-01T06:58:09.801-04:00, 51.0, 51.0, 51.0, 51.0, 51.0, 51.0, 51.0, 51.0, 51.0, 51.0, 100.0],
[Text, 3.0, 33.2, -81.2, 2013-05-02T05:32:04.970-04:00, 52.0, 52.0, 52.0, 52.0, 52.0, 52.0, 52.0, 52.0, 52.0, 52.0, 100.0]
]"
}
//************ code
String json = SyncResponse.toString();
JsonObject root = parser.parse(json).getAsJsonObject();
System.out.println("root" + root); //this is where I got the JSON output listed above