Running the WebSocketExample, I get the following error:
My device connects fine and I can send messages to the Server.
The error occurs when I send from the server to the device running WebSocketExample.
B4X:
LogCat connected to: 0123456789ABCDEF
--------- beginning of main
--------- beginning of system
Copying updated assets files (1)
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
TextMessage Error: (RuntimeException) java.lang.RuntimeException: JSON Object expected.
TextMessage Error: (RuntimeException) java.lang.RuntimeException: JSON Object expected.
Error occurred on line: 40 (WebSocketHandler)
java.lang.RuntimeException: JSON Object expected.
at anywheresoftware.b4a.objects.collections.JSONParser.NextObject(JSONParser.java:50)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:708)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:337)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at anywheresoftware.b4a.objects.WebSocketWrapper$1.onTextMessage(WebSocketWrapper.java:77)
at de.tavendo.autobahn.WebSocketConnection$2.handleMessage(WebSocketConnection.java:392)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5631)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)
TextMessage Error: (Exception) java.lang.Exception: java.lang.RuntimeException: JSON Object expected.
My device connects fine and I can send messages to the Server.
The error occurs when I send from the server to the device running WebSocketExample.