title: How to connect to AVD
body: <p>i'm trying to write my own android http server. It's quite OK but i have a problem with my AVD. I don't want to download my app to phone everytime I want to test changes. I would like to connect to my app via AVD.
  To get the ip address i'm using this function:</p>
  
  <pre><code>private String getLocalIpAddress() {
  
  
          try {
              for (Enumeration&lt;NetworkInterface&gt; en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {
                  NetworkInterface intf = en.nextElement();
                  for (Enumeration&lt;InetAddress&gt; enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {
                      InetAddress inetAddress = enumIpAddr.nextElement();
                      if (!inetAddress.isLoopbackAddress()) { return inetAddress.getHostAddress().toString(); }
                  }
              }
          } catch (SocketException ex) {
              Log.e("ServerActivity", ex.toString());
          }
          return null;
      }
  </code></pre>
  
  <p>on my phone everything works good, but when i run my app on AVD it shows ip: 10.0.2.15
  and i'm unable to connect to it.
  Is there any way to connect to my app running on AVD ? 
  If it does matter my app uses port 8080.</p>