0

I have listview having customized some textview and one imageview. When I long click on item I have store that item information to the database but the question is how to store image in sdcard and store the relevant path to the database. The image alread download as cache now I don't want to re-download that image.

Is there way to store that Image to the sdcard.

I am using this example to download the images for listview https://github.com/thest1/LazyList

Edit I got solution

no need to extra process when using this example. Just store the web path of image into the database and pass that imageview into the ImageLoader object with path it'll use the cache images if the image was exist for same URL

Pratik
  • 30,639
  • 18
  • 84
  • 159

3 Answers3

1

No Need to extra process, Using this example it'll will care for future usage also for same URL of image. This will get from the cache directory if the image found that use that image otherwise download it and then use it.

Pratik
  • 30,639
  • 18
  • 84
  • 159
0

If you use Prime the caching will be transparent, when you request the image again it will grab it from a memory cache if available or a disk cache automatically. It also is really easy to get images with.

HandlerExploit
  • 8,131
  • 4
  • 31
  • 50
0

You can save your bitmap which you get via Bitmap bitmap=memoryCache.get(url); using save-file-to-sd-card.


You can also get the bitmap from the ImageView(if you want) like:

//say your ImageView object is i;
i = (ImageView) findViewById(R.id.img);
Drawable d = i.getBackground();
Bitmap bitmap = ((BitmapDrawable)d).getBitmap();
Pratik
  • 30,639
  • 18
  • 84
  • 159
Imran Rana
  • 11,899
  • 7
  • 45
  • 51