Reading JSON from a text file

前端 未结 7 1465
隐瞒了意图╮
隐瞒了意图╮ 2021-02-09 01:30

I know of some JSON libs around and I\'m currently looking into Google-JSON but all I want to achieve is something simple and I want to know what you would suggest.

I wa

7条回答
  •  北恋
    北恋 (楼主)
    2021-02-09 02:04

    org.json.JSONException: Expected a ':' after a key at 148 [character 149 line 1]

    Here, your json string is invalid:

     + "'map': [ { 1,3,1,1,1,24,1,1,1,1,1,1,1 },"
    

    That creates and array with objects inside, the first object has the attributes 1,3,1 etc without value.

    Should be:

     + "'map': [ [ 1,3,1,1,1,24,1,1,1,1,1,1,1 ],"
    

    For that to be an array with arrays inside.

    Or

    + "'map': [ { 1:0,3:0,1:0,1:... 
    

    So you can have attributes 1,3,1 etc with value 0 but... that doesn't make sense

提交回复
热议问题