Erel, could you consider adding the following feature? B4A-Bridge indicates when a file transfer is in progress with 'progress'. Reason: in lower quality/bandwidth Wifi environments, it would be nice to have an indication the transfer started, and that it is making progress (ie, didn't stall/die).
Basically a packet counter is added, and with a value of -1 indicates no transfer occurring, 0 indicates started, and >0 is the packet count. Status line is updated with the value when > -1, ie, started/in-progress. When complete status returns to "Connected".
In Service1:
Sub Process_Globals
Dim APK_XFER_PacketCount As Int = -1
Sub HandleFileStart
Log("Installing file.")
APK_XFER_PacketCount = 0
CallSubDelayed(Main, "UpdateStatus")
Sub HandleFilePacket(Buffer() As Byte)
Try
Out.WriteBytes(Buffer, 1, Buffer.Length - 1)
APK_XFER_PacketCount = APK_XFER_PacketCount + 1
CallSubDelayed(Main, "UpdateStatus")
Sub HandleFileClose
APK_XFER_PacketCount = -1
CallSubDelayed(Main, "UpdateStatus")
In B4a-Bridge.b4a:
Sub UpdateStatus
If Service1.ConnectedStatus Then
If Service1.APK_XFER_PacketCount > -1 Then
lblStatus.Text = "File Transfer: " & Service1.APK_XFER_PacketCount
Else
lblStatus.Text = "Status: Connected"
End If
I do some work near the limits of my current Wifi access point, and sometimes when I kick off an Alt-3, it never makes it to the "Install" step on the android, and the GUI sits in "Debug". Presently only an "Installing" makes it into the Log, and if the Wifi is good enough it shows in the GUI log.
You might also consider a packet number in each packet after the command byte, and a total count in the start/filename packet; then percentage could be displayed and you can detect a missed packet. However as you know that would require a B4A release, so in the future perhaps.
In the meantime I modified a copy of Bridge-B4A here.
-Chris