Network Lib 1.10 Document said that:
Host As String [read only]
This method is deprecated and will not work properly on Android 4+ device.
Use HostAddress instead.
HostAddress As String [read only]
Gets the IP address of the sending machine.
In fact, I can't find HostAddress. Host is still there and it worked not always correct
Sub Activity_Create(FirstTime As Boolean)
for B4A UDP Sample:
Sub UDP_PacketArrived (Packet As UDPPacket)
Dim msg as string
msg = BytesToString(Packet.Data, Packet.Offset, Packet.Length, "UTF8")
Msgbox("Received msg [" & msg & " ] from Host:" & Packet.HostAddress & " Port:" & Packet.Port ,"Debug")
Return
End Sub
If you use Packet.HostAddress, it'll compile error-- HostAddress is not existed at all.
If you use Packet.Host you'll get incorrect host name very often (My Tablet is Google Asus NEXUS 2 Android 4.3)
Wewe
This method is deprecated and will not work properly on Android 4+ device.
Use HostAddress instead.
Gets the IP address of the sending machine.
In fact, I can't find HostAddress. Host is still there and it worked not always correct
Sub Activity_Create(FirstTime As Boolean)
for B4A UDP Sample:
Sub UDP_PacketArrived (Packet As UDPPacket)
Dim msg as string
msg = BytesToString(Packet.Data, Packet.Offset, Packet.Length, "UTF8")
Msgbox("Received msg [" & msg & " ] from Host:" & Packet.HostAddress & " Port:" & Packet.Port ,"Debug")
Return
End Sub
If you use Packet.HostAddress, it'll compile error-- HostAddress is not existed at all.
If you use Packet.Host you'll get incorrect host name very often (My Tablet is Google Asus NEXUS 2 Android 4.3)
Wewe