public static final String readURL(String url)throws Throwable
{
try {
InputStream in = (InputStream) fetch(url);
byte[] bArr = readBytes(in);
return new String(bArr);
} catch (Throwable e) {
throw e;
}
}
public static final Object fetch(String address) throws MalformedURLException,IOException {
URL url = new URL(address);
Object content = url.getContent();
return content;
}
Estoy detrás de un proxy y cuando intento¿Cómo arreglo esta UnknownHostException?
readURL ("http://abc.com")
acceder a la URL http://abc.com arroja java.net.UnknownHostException: tengo:
<uses-permission android:name="android.permission.INTERNET" />
en el archivo de manifiesto.
¿Alguna solución rápida?
Dupe: http://stackoverflow.com/questions/1432961/how-do-i-make-httpurlconnection-use-a-proxy –