0

I'm a beginner in android development ... i want to know how to create a json structure, with using arraylists and hashmaps ... you can find the structure as follows ... NOTE: I don't want to use JSONArray or JSONObject

[
[
{
  "blog_owner" : "user",
  "icalIssueEventID" : "",
  "updated_date" : "2014-02-17 07:05:53 +0000",
  "icalEventID" : "",
  "blog_stage" : "Cancelled",
  "blog_ID" : "GMpk20140206160708281",
  "created_date" : "2014-02-06 10:37:38 +0000",
  "emailFlag" : false
}
],
[
{
  "blog_iNotes_ID" : "",
  "blog_name" : "",
  "blog_status" : "",
  "blog_duration" : ""
},
{
  "pid" : "0",
  "isOpen" : true,
  "id" : "R1",
  "level" : 0,
  "value" : [
    {
      "level" : 0,
      "id" : "MA20140206181038936",
      "type" : "meetingAgenda",
      "isOpen" : true,
      "value" : [
        {
          "pid" : "MA20140206181038936",
          "level" : 1,
          "id" : "CN20140207211127374",
          "isOpen" : false,
          "value" : [

          ],
          "line_number" : 13,
          "keyItem" : "Fgh",
          "isCategorySelected" : false
        },
        {
          "line_number" : 14,
          "level" : 1,
          "id" : "CN20140217123343769",
          "isOpen" : true,
          "value" : [

          ],
          "keyItem" : "Fghh",
          "isCategorySelected" : false,
          "pid" : "MA20140206181038936"
        },
        {
          "pid" : "MA20140206181038936",
          "level" : 1,
          "id" : "ISS20140217123542229",
          "isOpen" : true,
          "type" : "Issues",
          "value" : [

          ],
          "type_KeyItem" : {
            "tfImpact" : "",
            "tvIssueDescription" : "",
            "tfActionRequired" : "Ffg",
            "tfResponsible" : "",
            "targetDate" : "Month DD YYYY"
          },
          "keyItem" : "Issues",
          "isCategorySelected" : true,
          "line_number" : 15
        }
      ],
      "type_KeyItem" : {
        "tfAgendaTitle" : "New agenda for magic minutes",
        "lblDuration" : "00:00",
        "tfAgendaName" : ""
      },
      "line_number" : 11,
      "isCategorySelected" : false,
      "pid" : "R1"
    }
  ],
  "isCategorySelected" : false,
  "keyItem" : "root",
  "line_number" : 10
}
],
[
]
]

1 Answer 1

1

You can use google-gson library for converting JSON to Java objects and vice-versa.

Some other helpful links are :

1) http://www.javacreed.com/simple-gson-example/

2) http://www.mkyong.com/java/how-do-convert-java-object-to-from-json-format-gson-api/

Hope this will help you.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.