title: Android 2.2 readUTF() Socket Problem
body: <p>I am trying to create a Java Client-Server Program, where the Server is running on a Windows PC, and the Client is running on an Android 2.2 Phone.</p>
  
  <p>The Connection is okay. Sending Data from the Phone to the PC works also fine.
  Just receiving Data on the Phone crashes the program.</p>
  
  <p>I am using DataInputStream and DataOutputStream to read/write through the Socket.</p>
  
  <pre><code>    //Thread on the Phone
      public void run() {
      while (RUN) {
  
          if (socket != null &amp;&amp; socket.isConnected()) {
              try {
                  //Crash
                  String text = dis.readUTF();
                  myTextView.setText(text);
  
              } catch (IOException ex) {
                  //ErrorHandling
              }
  
          }
  
      }
  }
  </code></pre>
  
  <p>I want to receive a String from the server and then show it in a TextView.
  Any Ideas? I am already setting this permission:</p>
  
  <p><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt;</code></p>
  
  <p>do i need any other permissions? Thanks.</p>