DownloadConfig
data class DownloadConfig(val url: String, val fileName: String, val title: String = fileName, val description: String = "", val mimeType: String = "*/*", val destinationDir: String = Environment.DIRECTORY_DOWNLOADS, val requiresWifi: Boolean = false, val allowMetered: Boolean = true, val visibleInNotification: Boolean = true)(source)
Describes a download task to be performed via DownloadManager.
Use the provided presets:
DownloadConfig.publicFile -> Public Downloads folder, notification visible upon completion.
Example usage:
val config = DownloadConfig(
url = "https://example.com/file.pdf",
fileName = "document.pdf",
title = "Financial Report",
requiresWifi = true
)
val downloadId = downloadHelper.enqueue(config)Content copied to clipboard