how do i make a application in android studio that creates a udpclient then you can enter the ip port then message of the datagram like anything you typed in the string or somthing then click the send buton.
try
{
socket.connect(host, port);
}
like socket.connect in c# for java in android studio.
socket = new
Socket(addressfamily.internetwork, sockettype.dgram, protocaltype.udp);
byte[] bytes2 = encoding.utf8.getbytes(s);
try{
socket.connect(host, port);
}
socket.send(bytes2);
thats an example of it in c# on windows but i wanna know how to do the same thing but for android in android studio.