B4X:
Map1.Clear
For xx = 0 To 10' Contactz.Size-1
Map1.Put("name",xx)
Map1.Put("mobile",xx)
Data.InsertAt(xx,Map1)
JSONGenerator.Initialize2(Data)
Log (JSONGenerator.ToPrettyString(1))
Next
'
here is the output
JSON:
[
{
"name": 0,
"mobile": 0
}
]
2nd run
JSON:
[
{
"name": 1,
"mobile": 1
},
{
"name": 1,
"mobile": 1
}
]
3rd run
JSON:
[
[
{
"name": 2,
"mobile": 2
},
{
"name": 2,
"mobile": 2
},
{
"name": 2,
"mobile": 2
}
]
however the final output should be
JSON:
[
{
"name": 0,
"mobile": 0
},
{
"name": 1,
"mobile": 1
},
{
"name": 2,
"mobile": 2
}
]
hope you guys can help i've been hammering my brains for a while now