this error will show up if you start to literate through the parsed record
B4X:
Dim pjson As JSONParser
Dim jsonstr As String = "[{display=MA . ., setup=false, muted=false}]"
Dim sparticpants As String = jsonstr
pjson.Initialize(sparticpants)
If pjson <> Null Then
If pjson.IsInitialized Then
Dim MuserList As List
MuserList = pjson.NextArray
If MuserList.Size > 0 Then
Log(MuserList)
End If
End If
End If
Dim parser As JSONParser
parser.Initialize(<text>)
Dim jRoot As List = parser.NextArray
For Each coljRoot As Map In jRoot
Dim display As String = coljRoot.Get("display")
Dim setup As String = coljRoot.Get("setup")
Dim muted As String = coljRoot.Get("muted")
Next
Dim parser As JSONParser
parser.Initialize(<text>)
Dim jRoot As List = parser.NextArray
For Each coljRoot As Map In jRoot
Dim display As String = coljRoot.Get("display")
Dim setup As String = coljRoot.Get("setup")
Dim muted As String = coljRoot.Get("muted")
Next
Dim parser As JSONParser
parser.Initialize(<text>)
Dim jRoot As List = parser.NextArray
For Each coljRoot As Map In jRoot
Dim display As String = coljRoot.Get("display")
Dim setup As String = coljRoot.Get("setup")
Dim muted As String = coljRoot.Get("muted")
Next
when a json converted to a string its formated that way without cutations .. i dont think its from the backend , i guess display name has a invisible characters that cause this error if you change the display name to anything else it will work
example
B4X:
Dim pjson As JSONParser
Dim jsonstr As String = "[{display=anything, setup=false, muted=false}]"
Dim sparticpants As String = jsonstr
pjson.Initialize(sparticpants)
If pjson <> Null Then
If pjson.IsInitialized Then
Dim MuserList As List
MuserList = pjson.NextArray
If MuserList.Size > 0 Then
Log(MuserList)
End If
End If
End If
your "jsonstring" is not a json string or object. it was a jason object before having been
subjected to "toString()" and then returned it to you from some processing method.
many, many java objects can be seen in a string form with the "toString()" method.
in the case of a map (json object), "="'s replace ":"'s.
your first hint is the use of "=" instead of ":". that is the default stringifying of a
map. the second hint is the lack of strings as keys. this is a json requirement.
(values need only be valid json types). exhange ":" for "=" and put quotes around all
the keys.
so, the various fiddlings suggested above, will get you to where you need to be, but
you need to recognize when something is a valid json string or object. json has rules.