Sub GetPkg As List
Dim pm As PackageManager
Dim res As List
res.Initialize
For Each p As String in pm.GetInstalledPackages
res.Add(CreateMap("package": p))
Next
Return res
End Sub
data.Put("packages", GetPkg)
Hiding your code is the best way not to get help.
Create a map with most of the entries.
Then create a list and put two maps in it for the entries into this list.
add this list as to your 1st map with the key packages.
Hiding your code is the best way not to get help.
Create a map with most of the entries.
Then create a list and put two maps in it for the entries into this list.
add this list as to your 1st map with the key packages.
Dim data As Map
data.Initialize
data.Put("devid",devid)
data.Put("bateria",bateria)
data.Put("latitud",latitud)
data.Put("longitud",longitud)
data.Put("speed",speed)
data.Put("apkver",Application.VersionCode)
data.Put("rc",rc)
data.Put("alarm",alarm)
data.Put("internet",internet)
data.Put("rssi",0)
data.Put("product",Product)
data.Put("manufacturer",Manufacturer)
data.Put("model",Model)
data.Put("fuse_latitud",fuse_latitud)
data.Put("fuse_longitud",fuse_longitud)
data.Put("fuse_speed",fuse_speed)
data.Put("fuse_altitud",fuse_altitud)
Dim d2 As JSONGenerator
packages.Initialize
Dim o As JSON = GetPkg
d2.Initialize2(o)
data.Put("packages",d2)
Dim d As JSONGenerator
d.Initialize(data)
Log(d.ToString)
'ToastMessageShow(d.ToString,True)
'Dim d2 As JSONGenerator
'packages.Initialize
'Dim o As JSON = GetPkg
'd2.Initialize2(o)
'data.Put("packages",d2)
Dim packages As List
packages.Initialize
packages.Add(CreateMap("package": "youtube"))
packages.Add(CreateMap("package": "amazon"))
data.Put("packages", packages)
'Dim d As JSONGenerator
'd.Initialize(data)
'Log(d.ToString)
Log(data.As(JSON).ToString)
Sub GetPkg
Dim pm As PackageManager
Dim packages As List
packages = pm.GetInstalledPackages
For i = 0 To packages.Size - 1
Log(packages.Get(i))
data.Put(i, packages.Get(i))
Next
End Sub
Sub GetPkg As List
Dim pm As PackageManager
Dim res As List
res.Initialize
For Each p As String in pm.GetInstalledPackages
res.Add(CreateMap("package": p))
Next
Return res
End Sub
data.Put("packages", GetPkg)
Sub GetPkg As List
Dim pm As PackageManager
Dim res As List
res.Initialize
For Each p As String in pm.GetInstalledPackages
res.Add(CreateMap("package": p))
Next
Return res
End Sub
data.Put("packages", GetPkg)