我使用了以下代码:
Socket client = new Socket(etIp.getText().toString(), 515);
String printText = "This is a print test from Wifi";
byte[] mybytearray = printText.getBytes();
OutputStream outputStream = client.getOutputStream();
outputStream.write(mybytearray, 0, mybytearray.length); //write file to the output stream byte by byte
outputStream.flush();
outputStream.close();
client.close();
套接字连接打开,在输出流中完成写入数据的过程中没有异常。但打印机不弹出页面。
请帮助我做错了什么。