title: How to open port in Android?
body: <p>How can I open a specific port in android?</p>
  
  <p>I have a server socket but the connection is rejected because the port is closed.</p>
  
  <pre><code>try {
     ServerSocket server = new ServerSocket(2021);
     Socket client = server.accept(); 
  } catch (Exception e) {
     // TODO Auto-generated catch block
     a = false;
     e.printStackTrace(); 
  } 
  </code></pre>