How to Send data (Client/Server)

fabianr

Member
Licensed User
Longtime User
I am tried make an application client/server. The Server is done in Delphi, and the Client en Basic4Android.

My Question is how to send data for than the server receive the data and for example do an action according to the text sent.

My Client:

B4X:
Sub Process_Globals
    Dim Socket1 As Socket   
End Sub

Sub Globals
Dim Button1 As Button

End Sub 

Sub Activity_Create(FirstTime As Boolean)
activity.LoadLayout("Ventana1")
    Socket1.Initialize("Socket1")
    Socket1.Connect("192.168.1.4",8721,20000)
End Sub

Sub Socket1_Connected (Successful As Boolean)
    If Successful = False Then
        Msgbox(LastException.Message, "Error connecting")
        Return
    End If
   
End Sub

Sub Button1_Click
'[B]HERE IS THE CODE YOU SHOULD SEND THE TEXT[/B]
End Sub

:sign0085:
Gracias.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…