title: java.net.UnknownHostException with Android app
body: <p>i am having this challenge that have been driving me crazy and don't know how to fix it. I have developed an android application that will post some data to a remote url using post. here is my method to handle that</p>
  
  <pre><code>public static String fetchStringFromRemotePOST(String url,List&lt;NameValuePair&gt; nameValuePairs){
      HttpClient client = new DefaultHttpClient();
      HttpPost post = new HttpPost(url);
      Log.i("URL",url);
      String line = "";
      String content = "";
      try{
          post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
          HttpResponse response = client.execute(post);
  
          BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
  
          while ((line = rd.readLine()) != null) {
            content += line;              
          }
      }catch(Exception e){
          Log.d("String Fetch ERROR",e.toString());
      }
      return content;
  }
  </code></pre>
  
  <p>and to call the method</p>
  
  <pre><code>List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(1);
  nameValuePairs.add(new BasicNameValuePair("post","okpokor"));      
  String url = "http://wwww.host.com/post.php";    
  String response = UtilMethod.fetchStringFromRemotePOST(url,nameValuePairs);
  </code></pre>
  
  <p>And also, i have included the internet permission in the Android manifest file</p>
  
  <pre><code>&lt;uses-permission 
          android:name="android.permission.INTERNET" /&gt;
  &lt;application
   ...
  </code></pre>
  
  <p>I have gone through the same problem discussed on other threads previously and none of the suggestions really worked for me, suggestions like re-starting the Eclipse and AVD.</p>
  
  <p>Really need help!</p>