El nombre del host no puede ser nulo en la ejecución de HttpResponse para Android
Recibo el error "El host de destino no debe ser nulo, o configurado en parámetros".
HAGO tengo permiso de internet en mi archivo manifiestoHe puesto 'http: //' antes de mi URLHAGO codificar la URLEste es mi código:
String url = "http://maps.google.com/maps/api/directions/json?origin=1600 Pennsylvania Avenue NW, Washington, DC 20500&destination=1029 Vermont Ave NW, Washington, DC 20005&sensor=false";
HttpClient httpclient = new DefaultHttpClient();
String goodURL = convertURL(url);//change weird characters for %etc
HttpPost httppost = new HttpPost(goodURL);
HttpResponse response = httpclient.execute(httppost);
En la quinta línea (la última línea arriba), mi programa lanza una excepción. Aquí está el error exacto:
java.lang.IllegalArgumentException: Host name may not be null
Yo sí codifico mi cadena en el método convertURL ...
goodURL =http://maps.google.com/maps/api/directions/json?origin=3%20Cedar%20Ave%2c%20Highland%20Park%2c%20NJ%2008904&destination=604%20Bartholomew%20Road%2c%20Piscataway%2c%20New%20Jersey%2008854&sensor=false
¿Alguna sugerencia? ¡Gracias!