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:

Example usage:

val config = DownloadConfig(
url = "https://example.com/file.pdf",
fileName = "document.pdf",
title = "Financial Report",
requiresWifi = true
)
val downloadId = downloadHelper.enqueue(config)

Constructors

Link copied to clipboard
constructor(url: String, fileName: String, title: String = fileName, description: String = "", mimeType: String = "*/*", destinationDir: String = Environment.DIRECTORY_DOWNLOADS, requiresWifi: Boolean = false, allowMetered: Boolean = true, visibleInNotification: Boolean = true)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val url: String
Link copied to clipboard