Hi. I'm trying to write a basic application with http get request. Eclipse validated my code, but when I using IOException in Android console I have this strange messages:
trouble writing output: null
[2009-07-29 17:22:49 - myapp] Conversion to Dalvik format failed with error 2
And my application doesn't load into the emulator. This is my code:
HttpHost target = new HttpHost("google.com", 80);
HttpGet get = new HttpGet("/");
String result = null;
HttpEntity entity = null;
HttpClient client = new DefaultHttpClient();
try {
HttpResponse response=client.execute(target, get);
entity = response.getEntity();
result = EntityUtils.toString(entity);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (entity!=null){}
try {
entity.consumeContent();
} catch (IOException e) {}
}
return result;
Anyone knows what is the problem?