Obtenha xml de um URL de serviço da web php usando android
Quero ler um xml de um URL de serviço, escrevi o código, meu URL está ok, visto no navegador,
public String getXML(){
String line = null;
try {
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet httpPost = new HttpGet("http://localhost/simplewebservice/index.php?user=1");
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
line = EntityUtils.toString(httpEntity);
} catch (Exception ex) {
Log.d("Error reading xml", ex.toString());
}
return line;
}
Mas dá-me o seguinte errojava.net.SocketException: Permission denied
. Alguém pode ter uma solução melhor para isso?
Atenciosamente
Pritom.