hi i m trying to get my database result in array
when i execute the query it show me
respostadoservidor is string
respostadoservidor = "Array[{"NomeCompleto":"Douglas Farias"}]"
OK I HAVE ONE ARRAY WITH MY COMPLETE NAME
but i have error to get("NomeCompleto")
i m trying to use parserface.NextArray and parserface.NextValue
and show me error
here is the codes and logs
when i try parserface.NextArray this give error on this line
when i try
parserface.NextValue give me error on line 112
when i execute the query it show me
respostadoservidor is string
respostadoservidor = "Array[{"NomeCompleto":"Douglas Farias"}]"
OK I HAVE ONE ARRAY WITH MY COMPLETE NAME
but i have error to get("NomeCompleto")
i m trying to use parserface.NextArray and parserface.NextValue
and show me error
here is the codes and logs
B4X:
Dim listaface As List
Dim contaface As String
Dim parserface As JSONParser
Dim mface As Map
Dim contaface As String
mface.Initialize
parserface.Initialize(respostadoservidor)
listaface.Initialize
listaface = parserface.NextArray 'line 110
mface = listaface.Get(0) 'line 112
contaface = mface.Get("NomeCompleto")
when i try parserface.NextArray this give error on this line
(Intent) Intent { act=android.intent.action.MAIN flg=0x20000000 cmp=achou.ganhou.vallow/.main }
no extras
** Activity (main) Pause, UserClosed = false **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (logar) Create, isFirst = true **
** Activity (logar) Resume **
** Service (httputils2service) Create **
** Service (httputils2service) Start **
Array[{"NomeCompleto":"Douglas Farias"}]
Error occurred on line: 110 (logar)
java.lang.RuntimeException: JSON Array expected.
at anywheresoftware.b4a.objects.collections.JSONParser.NextArray(JSONParser.java:62)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:636)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:302)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
at anywheresoftware.b4a.BA$3.run(BA.java:319)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5102)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
** Activity (main) Resume **
when i try
parserface.NextValue give me error on line 112
(Intent) Intent { act=android.intent.action.MAIN flg=0x20000000 cmp=achou.ganhou.vallow/.main }
no extras
** Activity (main) Pause, UserClosed = false **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (logar) Create, isFirst = true **
** Activity (logar) Resume **
** Service (httputils2service) Create **
** Service (httputils2service) Start **
Array[{"NomeCompleto":"Douglas Farias"}]
Error occurred on line: 112 (logar)
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List
at anywheresoftware.b4a.objects.collections.List.Get(List.java:117)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:636)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:302)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
at anywheresoftware.b4a.BA$3.run(BA.java:319)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5102)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
** Activity (main) Resume **