0

how to implement lazy loading with SQLite?

I have list of contacts in DB with the image path.
The circular head will load the image , from the db saved path.
Layout view

2
  • If it's only a colored circle with a letter, can't you just use a TextView with a background drawable, instead? No need for incomodating SQLite. Nor lazy loading. Commented Jul 30, 2016 at 16:23
  • How to load image , from the the folder path with lazy loading? Commented Jul 30, 2016 at 20:13

1 Answer 1

1

In this case, the easiest and safest way is to use Picasso open-source library from Square company. It provides all necessary features out-of-the-box. If you apply in your ListAdapter code snippet like this:

Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView);

Then it will load images on your list in a lazy way. Instead of a web address, you can also use the path to the file located on the device. Asynchronous loading is handled by the library under the hood. Check out the documentation on their page: http://square.github.io/picasso/ and project on GitHub: https://github.com/square/picasso.

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.