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?

Kothar
6,6393 gold badges36 silver badges45 bronze badges
asked Feb 14, 2012 at 16:34
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.

answered Feb 15, 2012 at 1:26
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.

answered Feb 14, 2012 at 17:30

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.