This is made to talk to vb6 winsock listening app.
It works good on the emulator.
Does not work on a real device.:sign0163:
I've tried most all of the obvious things i think. again it works good on the emulator.
The device is on a Local Wifi network trying to talk to a local PC running a vb6 app setup to listen and accept any requests to connect. The device has permission to be on the network. I've tried different ports I've tried different android devices. I've tried using the b4aBridge. Nothing works but the emulator.
Can I use LogCat to find out? LogCat shows no info other then Pause and Resume and Create. Nothing about Socket attempts.
It works good on the emulator.
Does not work on a real device.:sign0163:
I've tried most all of the obvious things i think. again it works good on the emulator.
The device is on a Local Wifi network trying to talk to a local PC running a vb6 app setup to listen and accept any requests to connect. The device has permission to be on the network. I've tried different ports I've tried different android devices. I've tried using the b4aBridge. Nothing works but the emulator.
Can I use LogCat to find out? LogCat shows no info other then Pause and Resume and Create. Nothing about Socket attempts.
B4X:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim Socket1 As Socket
Dim ServerSocket1 As ServerSocket
Dim AStreams As AsyncStreams
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim btnConnect As Button
Dim btnClose As Button
Dim btnTest As Button
Dim lvLog As ListView
Dim lblMyIP As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
'Todo: Change typeface of lvLog
lvLog.SingleLineLayout.ItemHeight = 16dip
lvLog.SingleLineLayout.Label.TextSize = 12
lblMyIP.Text = ServerSocket1.GetMyIP
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub btnTest_Click
Dim Buffer() As Byte
msg = "Hello"
Buffer = msg.GetBytes("UTF8")
Astreams.Write(Buffer)
lvLog.AddSingleLine ("Sent " & msg)
End Sub
Sub btnConnect_Click
Socket1.Initialize("Socket1")
Socket1.Connect("192.168.10.110",81,5000)
lvLog.AddSingleLine ("Do Connect")
End Sub
Sub btnClose_Click
Socket1.Close
lvLog.AddSingleLine ("Do Close")
End Sub
Sub Socket1_Connected(Connected As Boolean)As Boolean
If Connected = True Then
AStreams.Initialize(Socket1.InputStream,Socket1.OutputStream,"Astreams")
lvLog.AddSingleLine ("Is Connected")
End If
End Sub