Doing the code above I have an arraylist with url images in objImages
Element table2 = document.select("TABLE").get(1);
Elements asWithName = table2.select("tr>td a[name]");
for (Element aWithName : asWithName) {
String name = aWithName.attr("name");
hostName.add(name);
Element tr = aWithName.parent().parent();
for (Element td : tr.select("td")){
Element img = td.select("img").first();
if (img == null){
continue;
}
String imgRelPath = img.attr("src");
images.add("http://hostname.com"+imgRelPath);
}
objImages = images.toArray();
}
objHostName = hostName.toArray();
Fine, I have the URLs. Now I have to get the images from those URLs and put it in imageView, each image in different imageView.
I was doing with:
for {int i=0; i<objImages.length; i++}
InputStream input = new java.net.URL(objImages[i]).openStream();
bitmap = BitmapFactory.decodeStream(input);
...
}
The problem is that http://hostname.com/hobbit/gifs/static/green.gif is protected by user/password (with .htaccess file).
But it doesn't work. Any idea?
Thanks in advance.