Hi
I have a list object built with custom types
The list1 object is converted to Json format, after conversion I get such a Json string
I'm sending this string to a second phone using a QR code reader and want to rebuild the list object. I am using this tool and I am getting this code:
Now how to properly rebuild a list object? Any tips, suggestions, I've been struggling with it for 4 hours ...
I have a list object built with custom types
B4X:
Type modultemp(it As String, nm As String,ad As String, pt As Int, n1 As String, n2 As String, _
n3 As String,n4 As String, id As Int, ob As Int,ik As String, o1 As Int, o2 As Int, o3 As Int, o4 As Int, Mw As Int)
The list1 object is converted to Json format, after conversion I get such a Json string
B4X:
["[IsInitialized=true, Mw=0, ad=192.168.8.100\n, id=0, ik=obr2a.png, it=tempmulti.\n, n1=T1, n2=T2, n3=T3\n, n4=T4, nm=Moduł Temp., o1=1\n, o2=2, o3=3, o4=4\n, ob=1, pt=12345]","[IsInitialized=true, Mw=0, ad=192.168.1.100\n, id=2, ik=wloncznik.png, it=strprzekaznik.\n, n1=T1, n2=T2, n3=T3\n, n4=T4, nm=Moduł Przekaźnik, o1=1\n, o2=2, o3=3, o4=4\n, ob=1, pt=1024]","[IsInitialized=true, Mw=0, ad=192.168.1.100\n, id=3, ik=temciswilg2.png, it=cisni_temp_wilgot.\n, n1=T1, n2=T2, n3=T3\n, n4=T4, nm=Moduł Ciś.Temp.Wilg., o1=1\n, o2=2, o3=3, o4=4\n, ob=1, pt=1024]","[IsInitialized=true, Mw=0, ad=192.168.1.100\n, id=4, ik=temciswilg2.png, it=cisni_temp_wilgot.\n, n1=T1, n2=T2, n3=T3\n, n4=T4, nm=Moduł Ciś.Temp.Wilg., o1=1\n, o2=2, o3=3, o4=4\n, ob=1, pt=1024]","[IsInitialized=true, Mw=0, ad=192.168.8.100\n, id=5, ik=obr2a.png, it=tempmulti.\n, n1=T1, n2=T2, n3=T3\n, n4=T4, nm=Moduł Temp., o1=1\n, o2=2, o3=3, o4=4\n, ob=1, pt=12345]"]
I'm sending this string to a second phone using a QR code reader and want to rebuild the list object. I am using this tool and I am getting this code:
B4X:
Dim parser As JSONParser
parser.Initialize(my.json)
Dim root As List = parser.NextArray
For Each colroot As String In root
Next
Now how to properly rebuild a list object? Any tips, suggestions, I've been struggling with it for 4 hours ...
Last edited: