Hi!
I am having problem parsing a JSON from webservice , the ws return this
[[17,"clie12345","Chila Perez","-"],[18,"client1235778","Carlos Fuentes","Santiago"]]
This give me an error:
LISTA = parser.NextArray 'returns a list with maps
org.json.JSONException: End of input at character 0 of
at org.json.JSONTokener.syntaxError(JSONTokener.java:446)
at org.json.JSONTokener.nextValue(JSONTokener.java:93)
at anywheresoftware.b4a.objects.collections.JSONParser.NextArray(JSONParser.java:57)
at b4a.example.clientes._jobdone(clientes.java:463)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.keywords.Common$4.run(Common.java:930)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
org.json.JSONException: End of input at character 0 of
I took this example from MySQL example with Http2
I am having problem parsing a JSON from webservice , the ws return this
[[17,"clie12345","Chila Perez","-"],[18,"client1235778","Carlos Fuentes","Santiago"]]
B4X:
Log("Response from server: " & res)
Dim parser As JSONParser
'
'res=[[17,"clie12345","Chila Perez","-"],[18,"client1235778","Carlos Fuentes","Santiago"]]
parser.Initialize(res)
'
Dim LISTA As List
LISTA = parser.NextArray 'returns a list with maps
For i = 0 To LISTA.Size - 1
Dim m As Map
m = LISTA.Get(i)
'===============CREANDO UNA LINEA EN LA TABLA
'-----Agregando a la tabla-------
ID = m.Get("0") & CRLF & m.Get("1") 'ID record; ID empresa
Name = m.Get("2") & CRLF & m.Get("3") 'Nombre y direccion
TblClientes.AddRow(Array As String(ID, Name))
Next
LISTA = parser.NextArray 'returns a list with maps
org.json.JSONException: End of input at character 0 of
at org.json.JSONTokener.syntaxError(JSONTokener.java:446)
at org.json.JSONTokener.nextValue(JSONTokener.java:93)
at anywheresoftware.b4a.objects.collections.JSONParser.NextArray(JSONParser.java:57)
at b4a.example.clientes._jobdone(clientes.java:463)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.keywords.Common$4.run(Common.java:930)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
org.json.JSONException: End of input at character 0 of
I took this example from MySQL example with Http2