Introducing new Image Loader, Coil

Enrico Ori
TheOtherDev/s
Published in
Oct 30, 2020

--

How many of you download network images and cache them manually using LruCache? Ok, nobody. So, I suppose you all use an image loader library in your app. Somebody may be familiar with Picasso, someone else with Glide or even UIL. I personally use Glide a lot because it performs well and is user-friendly too. But a new tool is about to revolutionize the whole image loading process. It’s Coil: a new library entirely made in Kotlin which dumps Threads, Jobs, etc. in favor of coroutines

Coil promises an insane ease to use while having good performance, comparable to Picasso, allowing you load directly from the ImageView:

// URL
imageView.load("https://www.example.com/image.jpg")// Resource
imageView.load(R.drawable.image)// File
imageView.load(File("/path/to/image.jpg"))

While having this set of API, loading can be easily customized by defining custom targets, applying filters and transformations just like Glide does. Coil also has GIF support (provided with an additional package). It’s true that it’s a pretty new library, but it has a really high-performance and will be streamlined, for sure, more so that coroutines will be considered the new norm when talking about asynchronous tasks in Android.

Even if it’s not so recent, I invite you to read this article about performance tests comparisons between Picasso, Glide and Coil. Check out the official Coil page too, and give it a chance!

--

--

Enrico Ori
TheOtherDev/s

Just like the priest of Age Of Empires, I want an army of developers with me!!