Hello
I have the following json
Everything is fine in the code below
But I get an error in the second code
I have the following json
B4X:
{"icon_link":"https:\/\/xxxx.com\/xxxx_applications\/xxxx\/xxxxx\/weather 128x128\/color\/","icon_format":".png"}
Everything is fine in the code below
B4X:
Dim parser As JSONParser
parser.Initialize(job1.GetString)
Dim root As Map = parser.NextObject
Dim icon_link As String = root.Get("icon_link")
Dim icon_format As String = root.Get("icon_format")
But I get an error in the second code
B4X:
Dim parser As JSONParser
parser.Initialize(job1.GetString)
Dim root As Map = parser.NextObject
Dim icon_link As String = root.Get("icon_link")
Dim icon_format As String = root.Get("icon_format")
Dim cdc As Map = parser.NextObject
B4X:
Error occurred on line: 902 (Starter)
org.json.JSONException: End of input at character 140 of {"icon_link":"https:\/\/xxx.com\/xxxxx\/xxx\/xxxxx\/weather 128x128\/color\/","icon_format":".png"}
at org.json.JSONTokener.syntaxError(JSONTokener.java:449)
at org.json.JSONTokener.nextValue(JSONTokener.java:97)
at anywheresoftware.b4a.objects.collections.JSONParser.NextObject(JSONParser.java:65)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.shell.DebugResumableSub$RemoteResumableSub.resume(DebugResumableSub.java:22)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:267)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:137)
at anywheresoftware.b4a.BA$2.run(BA.java:387)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6138)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)