0
s = new Socket(InetAddress.getByName(server_address), server_port);
out = new PrintWriter(s.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(s.getInputStream()));

...

out.println("DESCRIBE " + url + " RTSP/1.0");
out.println("CSeq: 1");
out.println("");

String answer = null;
try {
    answer = in.readLine();
...

If it happen in java project all good and we get answer like "RTSP/1.0 200 OK\n", but if I run same code on android I haven't any response. Why?

2
  • Any exceptions shown in logcat? Commented Feb 14, 2012 at 16:48
  • No, logcat haven't any exception Commented Feb 15, 2012 at 8:51

2 Answers 2

1

Also println() isn't good enough. You have to send exactly \r\n as line terminators for most Internet protocols, not whatever your local system's line terminator is.

Sign up to request clarification or add additional context in comments.

Comments

0

My guess without you giving any kind of error messages is that you need to add the Internet permission to your app.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.