Android入門–Socket通信のサンプルコード
javaコード:
Socket socket = new Socket(“172.17.2.11", 10000);
OutputStream os = socket.getOutputStream();
PrintWriter cft = new PrintWriter(os);
cft.write(“connect to server");
cft.flush();
socket.shutdownOutput();
socket.close();