HI, I use JSONGenerator to generate simple json string to consume some web services.
but now I need to generate a more complex string.
I user this code for generate I simple string
now I need to generate more complex structure like this.
if some one can point me in the right direction.
Thanks.
Victor
but now I need to generate a more complex string.
I user this code for generate I simple string
B4X:
Dim Map1 As Map
Map1.Initialize
Map1.put("RetailId",global_variables.reatilid)
Map1.put("TerminalId",global_variables.terminalid)
Map1.put("SerialTF",global_variables.XSerial)
Map1.put("ValidationCode",global_variables.XSerial)
Dim Data1 As List
Data1.Initialize
Data1.add(Map1)
Dim JSONGenerator As JSONGenerator
JSONGenerator.Initialize2(Data1)
Msgbox(JSONGenerator.ToPrettyString(2), "")
now I need to generate more complex structure like this.
B4X:
{
"glossary": {
"title": "example glossary",
"GlossDiv": {
"title": "S",
"GlossList": {
"GlossEntry": {
"ID": "SGML",
"SortAs": "SGML",
"GlossTerm": "Standard Generalized Markup Language",
"Acronym": "SGML",
"Abbrev": "ISO 8879:1986",
"GlossDef": {
"para": "A meta-markup language, used to create markup languages such as DocBook.",
"GlossSeeAlso": ["GML", "XML"]
},
"GlossSee": "markup"
}
}
}
}
}
if some one can point me in the right direction.
Thanks.
Victor