android - How to create a JSON structure using Arraylist and Hashmap -
i'm beginner in android development ... want know how create json structure, using arraylists , hashmaps ... can find structure follows ... note: don't want 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 magic minutes", "lblduration" : "00:00", "tfagendaname" : "" }, "line_number" : 11, "iscategoryselected" : false, "pid" : "r1" } ], "iscategoryselected" : false, "keyitem" : "root", "line_number" : 10 } ], [ ] ]
you can use google-gson library converting json java objects , vice-versa.
some other helpful links :
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 you.
Comments
Post a Comment