Image Loading

This lesson goes over image loading from the internet.

Dependencies #

Loading an image from the Internet may sound like a trivial task, but it is not. There are a lot of cases which we would have to handle, some of them:

  • storing and retrieving the image from the RAM cache
  • storing and retrieving the image from the disk cache
  • scaling and resizing the image
  • displaying loading and error states
  • handling out of memory scenarios
  • handling concurrent image loading
  • etc.

To avoid handling all the scenarios described above, there are several popular image loader libraries developed and distributed as open source. The most popular are:

In this lesson, we are going to use the Glide image loader. Let’s add the new library dependencies to the app/build.gradle file in the dependencies section.

Get hands-on with 1400+ tech skills courses.