Tecnologia do Blogger.
RSS

[androidbrasil-dev] Erro Unable to resolve host

Tenho um metodo aonde verifico se a url esta disponível para acesso...só que
sempre me dá essa exceção ao debugar no XOOM 3.2.1

Unable to resolve host "http://www.google.com.br": No address associated
with hostname

Segue o metodo
public boolean testConnection(String url){
Socket socket = null;
boolean reachable = false;
try {
url = "http://www.google.com.br";
socket = new Socket(url,80);
reachable = true;
} catch(IOException e){
Log.e("E.Test Connnection 1",
e.getMessage());
}finally {
if (socket != null)
try {
socket.close();
} catch(IOException e) {
Log.e("E.Test Connection 2",
e.getMessage());
}
}


return reachable;
}

Att
Igor Nesralla Ribeiro

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comentários:

Postar um comentário