Creating Nested JSON in Android

前端 未结 1 1923
时光取名叫无心
时光取名叫无心 2021-01-16 12:49

Say I want to make the following JSON

{
    \"key\" : \"1234\",
    \"request\" : \"info\",
    \"info\" : {
        \"type\" : \"user\",
        \"login\" :         


        
1条回答
  •  野的像风
    2021-01-16 13:22

    If you work a lot with JSON data I would really recommend that you use Gson or Jackson. It's a lot more convenient and both of the libraries have very good support for converting to and from Java objects (which is a lot less messy and error prone than manually building your JSON through JSONObjects).

    0 讨论(0)
提交回复
热议问题