telnet ソケット入力から「アーティスト - タイトル」を解析したいと考えています。現在、最後の行「END」のみを表示しています。私は何を間違っていますか?java.plsヘルプの初心者です...
仕事に私の活動スクリプト:
try {
Socket s = new Socket("10.0.2.2", 5555);
BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream()));
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(s.getOutputStream(), "ISO8859_1"));
String on_air = "request.on_air" + System.getProperty("line.separator");
out.write(on_air);
out.flush();
Log.i("TcpClient", "sent: " + on_air);
String on_airin = in.readLine() + System.getProperty("line.separator");
Log.i("TcpClient", "received: " + on_airin);
String metadata = "ao.metadata "+ on_airin + System.getProperty("line.separator");
out.write(metadata);
out.flush();
Log.i("TcpClient", "sent2: " + metadata);
String metadatain = in.readLine() + System.getProperty("line.separator");
Log.i("TcpClient", "received: " + metadatain);
String line = in.readLine();
while (line != null) {
line = in.readLine();
System.out.println(line);
output = (TextView) findViewById(R.id.textView2);
output.setText(line);
//tv.setText(online + formatedDate );
output = (TextView) findViewById(R.id.textView1);
s.close();
}} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
私のSystem.out.println http://pastebin.com/SkfiPXar