victormedranop Well-Known Member Licensed User Longtime User Sep 13, 2021 #1 I am have and error on a valid JSON sting. this is the error i validate with http://basic4ppc.com:51042/json/index.html JSONLint - The JSON Validator JSONLint is the free online validator, json formatter, and json beautifier tool for JSON, a lightweight data-interchange format. jsonlint.com and its valid. i will attach the file, if someone can help me Code: Copy (JSONException) org.json.JSONException: End of input at character 75652 of [{"Id":55,"Codigo":55,"Barra":55,"Producto":"GALLETAS OREO VAINILLA Attachments json.txt json.txt 74 KB · Views: 468
I am have and error on a valid JSON sting. this is the error i validate with http://basic4ppc.com:51042/json/index.html JSONLint - The JSON Validator JSONLint is the free online validator, json formatter, and json beautifier tool for JSON, a lightweight data-interchange format. jsonlint.com and its valid. i will attach the file, if someone can help me Code: Copy (JSONException) org.json.JSONException: End of input at character 75652 of [{"Id":55,"Codigo":55,"Barra":55,"Producto":"GALLETAS OREO VAINILLA
DonManfred Expert Licensed User Longtime User Sep 13, 2021 #2 victormedranop said: i will attach the file, if someone can help me Click to expand... The file is valid. This is the code to parse it B4X: Copy Dim parser As JSONParser parser.Initialize(<text>) Dim root As List = parser.NextArray For Each colroot As Map In root Dim Categoria As String = colroot.Get("Categoria") Dim Codigo As Int = colroot.Get("Codigo") Dim Producto As String = colroot.Get("Producto") Dim Marca As String = colroot.Get("Marca") Dim Id As Int = colroot.Get("Id") Dim Imagen As String = colroot.Get("Imagen") Dim Barra As Int = colroot.Get("Barra") Dim Precio As Int = colroot.Get("Precio") Next Upvote 1
victormedranop said: i will attach the file, if someone can help me Click to expand... The file is valid. This is the code to parse it B4X: Copy Dim parser As JSONParser parser.Initialize(<text>) Dim root As List = parser.NextArray For Each colroot As Map In root Dim Categoria As String = colroot.Get("Categoria") Dim Codigo As Int = colroot.Get("Codigo") Dim Producto As String = colroot.Get("Producto") Dim Marca As String = colroot.Get("Marca") Dim Id As Int = colroot.Get("Id") Dim Imagen As String = colroot.Get("Imagen") Dim Barra As Int = colroot.Get("Barra") Dim Precio As Int = colroot.Get("Precio") Next
victormedranop Well-Known Member Licensed User Longtime User Sep 13, 2021 #3 As always you are right. I duplicate this line Code: Copy Dim root As List = parser.NextArray Thanks. Victor Upvote 0
As always you are right. I duplicate this line Code: Copy Dim root As List = parser.NextArray Thanks. Victor