title: Android Datagram Sockets not working
body: <p>I am trying to implement basic Datagram Sockets in Android. I am starting with one of the samples available on the web:</p>
  
  <pre><code>String messageStr="Hello Android!";
  int server_port = 54372;
  try {
    DatagramSocket s = new DatagramSocket();
    InetAddress local = null;
    local = InetAddress.getByName("192.168.100.127");
    int msg_length=messageStr.length();
    byte[] message = messageStr.getBytes();
    DatagramPacket p = new DatagramPacket(message, msg_length, local, server_port);
    s.send(p);
  } catch (SocketException e) {
    e.printStackTrace();
  } catch (UnknownHostException e) {
    e.printStackTrace();
  } catch (IOException e) {
    e.printStackTrace();
  }
  </code></pre>
  
  <p>I have enables the INTERNET permissions in AndroidManifest.xml:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  </code></pre>
  
  <p>The program dies when it hits the <code>s.send(p)</code> command.</p>
  
  <p>What am I missing? It must be something obvious.</p>