i receive this Packet "Quality:GOOD Level:250" from UDP
i have the following message and the for each does not work
This is my code
I would like this result
Quality:GOOD
Level:250
if the problem is in the string that arrives you can change it, in the arduino code
i have the following message and the for each does not work
B4X:
HiTouch restricted: AboardArea.
EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000
HWUI Binary is enabled
Error occurred on line: 102 (Main)
java.lang.RuntimeException: Method: getSize not found in: java.lang.String
at anywheresoftware.b4a.shell.Shell$MethodCache.getMethod(Shell.java:985)
at anywheresoftware.b4a.shell.Shell.getMethod(Shell.java:644)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:731)
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$2.run(BA.java:370)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:101)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
java.net.SocketException: Socket closed
at java.net.SocketInputStream.read(SocketInputStream.java:203)
at java.net.SocketInputStream.read(SocketInputStream.java:139)
This is my code
B4X:
Sub UdpSEvent_PacketArrived (Packet As UDPPacket)
Dim StringaArrivata As String=BytesToString(Packet.Data, Packet.Offset, Packet.Length, "ASCII")
For Each line As String In StringaArrivata ' in this line i have the error
Dim s() As String = Regex.Split(":", line)
Dim Qualità As String = s(0).Trim
Dim Livello As String = s(1).Trim
Next
EditTextReceiver.Text = BytesToString(Packet.Data, Packet.Offset, Packet.Length, "ASCII")
End Sub
I would like this result
Quality:GOOD
Level:250
if the problem is in the string that arrives you can change it, in the arduino code