UnknownHost Exception in Android
<p>My application was sending request to servlets frequently but since last day it starts giving <strong>UnknownHostException Exception</strong>.I don't know what is wrong with code which was working fine since 1 month.</p>

<p>I had added the permission to access internet in my manifest file .
My servlet is working fine with PC browser.</p>

<p>My code for calling servlet in Android is :</p>

<pre><code>String url = "http://sampark.iiit.ac.in:8080/VTSServlets/CurrentTripInfo?mobilenum=##########&amp;lat=10&amp;long=10"
String response = getResponse(url);



public static String getResponse(final String url)
 {
        final StringBuilder builder = new StringBuilder();
    final HttpClient client = new DefaultHttpClient();

    System.out.println("URL :: " + url);
    final HttpGet httpGet = new HttpGet(url);
    try {
        final HttpResponse response = client.execute(httpGet);
        final StatusLine statusLine = response.getStatusLine();
        final int statusCode = statusLine.getStatusCode();
        if (statusCode == 200) {
            final HttpEntity entity = response.getEntity();
            final InputStream content = entity.getContent();
            final BufferedReader reader = new BufferedReader(
                    new InputStreamReader(content));
            String line;
            while ((line = reader.readLine()) != null) {
                builder.append(line);
            }
        } else {
            builder.append("Not 200");
        }
    } catch (final ClientProtocolException e) {
        e.printStackTrace();
    } catch (final IOException e) {
        e.printStackTrace();
    }

    return builder.toString();
}

}
</code></pre>

<p>I have checked all requirements but dont know how it is giving UnknownHost Exception suddenly?I'm testing my application on android mobile.</p>
