0

My DataBase contains 1000's of images on server , I have to display these images in ListView in Android. I have to develop similar List like that in the Flipcart app(If User Scroll then download Images) and store a local copy in SQlite and display from that SQlite database.

(In future if connectivity would not be there then also I would be able to run my app) because Images will be available in SQlite.

Please suggest proper Solution for that. Use of loaderManager or something else please suggest

3
  • 1
    have you try any process? Commented Dec 28, 2013 at 7:48
  • You have to Lazy Load images, you have to use an AsyncTask or a Handler thread, you have to override the adapter class and you have to cache images. Rather than storing them in DB a better approach would be to store them on SDCard and save the Uri in local DB. Check out this tutorial: vogella.com/articles/AndroidListView/article.html Commented Dec 28, 2013 at 7:52
  • I was trying implementing "LoaderManager.LoaderCallbacks<Cursor>" but not sure whatever i doing is best and I am doing same downloading and saving in sd card and saving their uri in database. Commented Dec 28, 2013 at 9:04

1 Answer 1

1

I don't advise towards storing the images themselves in the SQLite database. The database will become slower to use and more cumbersome. Also, I think you should not implement such complex functionality yourself as there are many ready to use open source solutions.

There are a lot of solutions that allow you to cache the images on the file storage. They work transparently - when you request url they first check the local cache and only if this check does not exist they will make network call. Most of them also will display default thumbnail until the network call succeeds. Basically I think this is the best you can do.

I, myself have used Universal Image loader for what I describe, but out of this thread you can find many alternatives.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.