views:

12

answers:

1

Hi

we are working on a project where image data is coming from webservice and we need to display that image bitmap data in our phones, the images could have more than 500, so when we download data form webservice and displaying then in gallery with converting image data into bitmap, outofmemory error is coming and program crashes.

Please give suggestion to how to achieve this.

A: 

Don't keep the whole set in memory.

Either

  • download and convert lazily as the user scrolls, or
  • download, convert, and store to disk a few images at a time, and then load them lazily as the user scrolls.
mirzapirza
any example would be appreciated, thanks
Keshav Mishra