How can i fetch the large image from url

Posted by Kutbi on Stack Overflow See other posts from Stack Overflow or by Kutbi
Published on 2011-01-01T04:27:49Z Indexed on 2011/01/01 8:54 UTC
Read the original article Hit count: 326

Filed under:

i used below code to fetch the image from url.but its not working for large image..

i missing something to add for that type of image to fetch.

imgView = (ImageView)findViewById(R.id.ImageView01);
  imgView.setImageBitmap(loadBitmap("http://www.360technosoft.com/mx4.jpg"));

  //imgView.setImageBitmap(loadBitmap("http://sugardaddydiaries.com/wp-content/uploads/2010/12/how_do_i_get_sugar_daddy.jpg"));
     //setImageDrawable("http://sugardaddydiaries.com/wp-content/uploads/2010/12/holding-money-copy.jpg");
  //Drawable drawable = LoadImageFromWebOperations("http://www.androidpeople.com/wp-content/uploads/2010/03/android.png");
  //imgView.setImageDrawable(drawable);

 /* try {
     ImageView i = (ImageView)findViewById(R.id.ImageView01);
     Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL("http://sugardaddydiaries.com/wp-content/uploads/2010/12/holding-money-copy.jpg").getContent());
     i.setImageBitmap(bitmap); 
   } catch (MalformedURLException e) {
     System.out.println("hello");
   } catch (IOException e) {
    System.out.println("hello");
   }*/
    }


 protected Drawable ImageOperations(Context context, String string,
   String string2) {
  // TODO Auto-generated method stub
  try {
   InputStream is = (InputStream) this.fetch(string);
   Drawable d = Drawable.createFromStream(is, "src");
   return d;
  } catch (MalformedURLException e) {
   e.printStackTrace();
   return null;
  } catch (IOException e) {
   e.printStackTrace();
   return null;
  }

 }

© Stack Overflow or respective owner

Related posts about android