I'm debugging an app that is loading images from Flickr's webservice
API. I have a snippet of code that is using BitmapFactory.decodeStream
() to create a Bitmap from an InputStream reading from a URL to a jpeg
hosted on Flickr.

This code works fine in the emulator, but if I debug the same app on
my MyTouch3g, decodeStream() is returning null.

Any ideas?

Here's the piece of code:

Bitmap bm = null;
                try {
                        URL url = new URL(sourceUrl);
                        URLConnection conn = url.openConnection();
                        conn.connect();
                        InputStream is = conn.getInputStream();
                        BufferedInputStream bis = new BufferedInputStream(is, 
32000);

                        bm = BitmapFactory.decodeStream(bis);
                        bis.close();
                        is.close();
                } catch (IOException ioe) {
                        ioe.printStackTrace();
                        Log.e(APP_LOG_TAG, "Error getting bitmap", ioe);
                } catch (Exception e) {
                        e.printStackTrace();
                        Log.e(APP_LOG_TAG, "Error loading bitmap from Flickr: 
", e);
                }


Thanks, Kevin Hooke
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to