i tried your first example with aStreams and an esp8266 sending data through
"client.connect"; "client.println(...)"; and "client.stop();".
It works fine. The mobile receives all data.
But when i close the app - the connection still stays alive.
After starting the app again - it crashes and the connection is closed.
Now starting the app - all ok.
I don't use toastmessages ...
Sub Activity_Pause(UserClosed As Boolean)
If UserClosed Then
Log("closing")
AStreams.Close
Socket1.Close
End If
End Sub
This is not enough to end the connection?
here a part of the log after crash:
** Activity (main) Create, isFirst = false **
running waiting messages (1)
** Activity (main) Resume **
ON
AStreams_Terminated
main_astreams_terminated (java line: 413)
java.lang.RuntimeException: Object should first be initialized (Exception).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.B4AException.getMessage(B4AException.java:21)
at b4a.GvDIT_SOS.main._astreams_terminated(main.java:413)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
at anywheresoftware.b4a.BA$2.run(BA.java:365)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
sorry about my english ...
anyone know this problem? and can tell me the solution?