public static ImageLoader getImageLoader(Context context) {
    if (sImageLoader == null) {
      DisplayImageOptions displayImageOptions =
          new DisplayImageOptions.Builder()
              .showImageOnLoading(Drawables.sPlaceholderDrawable)
              .showImageOnFail(Drawables.sErrorDrawable)
              .cacheInMemory(true)
              .cacheOnDisk(true)
              .build();
      ImageLoaderConfiguration config =
          new ImageLoaderConfiguration.Builder(context)
              .defaultDisplayImageOptions(displayImageOptions)
              .diskCacheSize(ConfigConstants.MAX_DISK_CACHE_SIZE)
              .memoryCacheSize(ConfigConstants.MAX_MEMORY_CACHE_SIZE)
              .build();
      sImageLoader = ImageLoader.getInstance();
      sImageLoader.init(config);
    }
    return sImageLoader;
  }
Provides instance of ImageLoader with appropriately configured caches and placeholder/failure
drawables.
samples/comparison/src/main/java/com/facebook/samples/comparison/configs/uil/SampleUilFactory.java