

We’ve worked hard to make sure Coil covers the existing functionality supported by other image loaders, but we also wanted to throw in an additional unique feature: Dynamic image sampling Coil relies on Kotlin extension functions instead. Avoid annotation processing, which can often slow down build speeds.Coil also supports dependency injection, as it provides singleton and non-singleton artifacts. This allows you to write fake ImageLoader implementations for your tests. Coil’s main service class, ImageLoader, is an interface. These interfaces can be used to augment and/or override the base behavior and add support for new file types in Coil. Coil’s image pipeline is composed of three main classes Mappers, Fetchers, and Decoders. Also, Coil adds ~1500 methods to your APK (for apps that already use OkHttp and Coroutines), which is comparable to Picasso and significantly less than Glide and Fresco. Coil has almost 8x fewer lines of code than Glide and slightly less than Picasso. Similarly, AndroidX Lifecycles are now the recommended way to track lifecycle state Coil is the only image loading library that supports them. They’re efficient by default and allow Coil to avoid reimplementing disk caching and stream buffering. Square’s OkHttp and Okio are standard dependencies for every Android app. Leverage Kotlin Coroutines as they offer strong support for non-blocking asynchronous computation and work cancellation while maximizing thread reuse.Leverage Kotlin language features including extension functions, inlining, lambda params, and sealed classes to create a simple, elegant API.Coil was created with the following goals:

While there are several image loading library options for Android developers today, we felt there was an opportunity to create a more modern, simpler product.
