0

I have an app that downloads 15+ bitmaps and converts each one to byte arrays and stores them to a sqlite database (along with other data). Once the app is started again, it uses the sqlite info as a 'cached' version. It then converts the byte array back to a bitmap and shows them in a listview. My problem is, I can't find a good Lazy Loader to display the bitmap, they all uses urls to display. Any advice on how to make my app operate smoothy?

UPDATE: The app is a news reader and it stores all the article info (title, image, text etc..) to sqlite so when the device goes offline or the user saves an article for offline reading they can still access the article without internet.

arayray
  • 241
  • 6
  • 19
  • why are you using url to display bitmap, since it's cached in db you can draw bitmap in no time(Fastest) , using blob in sqlite database you can easily store and retrive bitmaps. – Viswanath Lekshmanan Nov 22 '13 at 04:30
  • storing a bitmap in sqlite is bad practice for better performance download bitmap store to sdcard and store only path of that image to database rather byte array. – Biraj Zalavadia Nov 22 '13 at 04:30
  • I would recommend androiquery framework which provides lazy loading and it handles image caching it self just pass the server url to download it will manage the caching and lazy loading.http://code.google.com/p/android-query/ – Biraj Zalavadia Nov 22 '13 at 04:36
  • Updated op with more detail on how the app uses the sqlite. – arayray Nov 22 '13 at 04:42

1 Answers1

0

Go through this. You have to use WeakReferences to cache images. @Janusz explains it clearly.

Community
  • 1
  • 1
Seshu Vinay
  • 13,560
  • 9
  • 60
  • 109