Best Approach on Downloading Image: Glide vs URL().openStream()
Which approach is better and why? Following is an example of downloading GIF file.
Using Glide:
private suspend fun downloadImage(context: Context, imageUrl: String, fileName: String, folderName: String) {
withContext(
Dispatchers.IO) {
val gifBuffer = Glide.with(context).asGif().load(imageUrl).submit().get().buffer
val imageUri = getImageUri(getApplication(), fileName, folderName)
context.contentResolver.openOutputStream(imageUri).use {
val bytes =...