String urlString = "http://bks7.books.google.com/books? id=EBY4AAAAMAAJ&printsec=frontcover&img=1&zoom=5&sig=ACfU3U2NGdob1xFo6l1Y07qriP1eOHArDw&source=gbs_gdata"; URL url = new URL(urlString); Bitmap bm = BitmapFactory.decodeStream(url.openStream());
Then, an exception pops up. *** 07-14 16:01:34.218: WARN/System.err(1219): java.io.IOException: Received authentication challenge is null 07-14 16:01:34.228: WARN/System.err(1219): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.doRequestInternal (HttpURLConnection.java:1592) 07-14 16:01:34.238: WARN/System.err(1219): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.doRequest (HttpURLConnection.java:1547) 07-14 16:01:34.258: WARN/System.err(1219): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getInputStream (HttpURLConnection.java:1055) 07-14 16:01:34.268: WARN/System.err(1219): at java.net.URL.openStream(URL.java:674) *** Actually, the url points to an image. Seems it needs some kind of authentication to connect to the url. But, I can open it with Firefox. Even in android, I can load it with WebView. Why can't I load the image with HttpURLConnection? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---