Hay Guys, I\'m new to Android but heres what i want to do.
I want to beable to open a connect to a server using a given IP and PORT, then send commands to the server
Use the java.net classes. Below is a simple example using DatagramSockets:
String cmd("my command");
try {
InetSocketAddress address = new InetSocketAddress("10.1.1.1", 12350);
DatagramPacket request = new DatagramPacket(cmd.getBytes(), cmd.length(), address);
DatagramSocket socket = new DatagramSocket();
socket.send(request);
} catch (SocketException e) {
...
}
} catch (IOException e) {
...
}
}
Other Java samples can be found here: