Dim DecoderNomiRealiListe As JSONParser
DecoderNomiRealiListe.Initialize(NomiRealiListe)
Dim NomiRealiListeDecodificate As Map = DecoderNomiRealiListe.NextObject
I obtain an error saying:
B4X:
org.json.JSONException: Unterminated object at character 297 of {523D837E66FF3EA3FE892ACFECA6112112984710068A03A367C22D04C8618242=Colleghi, 1705C6D36D0987B429A32DCF5A174339F9FD15B5E5011D2FB662FDAB7B2504D4=Familiari2, A06D3D4AFC9D233276FBD6969C625B77CD6EEA103346B1B6D575C07C8C523D72=Amici2, 41944DF4B2A83B5A85F14DFFA6F8212A3373B4E141B00F2489B4974F36EE8A1B=This is a test}
The char at position 297 corresponds at the space in the string.
The error seems to happen because the parser removes the quetes from the JSON string.
Hmm... I think the space is not the issue - there's something else that the parser doesn't like with the input or possibly the way it is processing/getting it.
What version of the JSON library are you using?
How are you parsing the string?
Have you debugged the code up to the point where the error occurs?
Sub JobDone (Job As HttpJob)
If Job.Success Then
Dim res As String
res = Job.GetString
res = "[" & res & "]" '<----- Add this
Log("Response from server: " & res)
Dim parser As JSONParser
parser.Initialize(res)
Select Job.JobName
......
OR ( better ) in your file php check that you have []
The JSON in my first post was just a portion of a bigger and more complex JSON object.
After debugging some hours i understood that i was parsing the whole JSON object in a wrong way, even if was everything working for months!
I solved everything using the super "debugging" tool: http://basic4ppc.com:51042/json/index.html