Hello everyone,
After a call to a webservice, I have job1.getString whit the following value:
Using the code provided by Erel:
I've got an error on line:
Which is:
It seems "[" and "]" are not accepted at the beginning of the string .....
Indeed, if I remove both from the string, it works ....
But they are part of JSON coding ...
Any idea ?
After a call to a webservice, I have job1.getString whit the following value:
[{"siteId": 7,"siteLibelle": "Belgium"},
{"siteId": 18,"siteLibelle": "Chile"},
{"siteId": 22,"siteLibelle": "Colombia"}]
Using the code provided by Erel:
B4X:
Dim JSON As JSONParser
Dim Map1 As Map
JSON.Initialize(Job1.GetString)
Map1 = JSON.NextObject
I've got an error on line:
B4X:
Map1 = JSON.NextObject
Which is:
Error occurred on line: 108 (ParserJSON)
java.lang.RuntimeException: JSON Object expected.
at anywheresoftware.b4a.objects.collections.JSONParser.NextObject(JSONParser.java:50)
It seems "[" and "]" are not accepted at the beginning of the string .....
Indeed, if I remove both from the string, it works ....
But they are part of JSON coding ...
Any idea ?