DownloadManager

Provides an implementation of IDownloadManager that uses an application database to track the requests. The requests placed in the database will be downloaded asynchronously in a separate process. Any request sets that have been marked for deletion will be cancelled.

Types

Link copied to clipboard
interface Listener
A listener that can be used to callback notifications about download requests.
Link copied to clipboard
Provides mutable implementation of IRequest, which can be used to submit download requests to the IDownloadManager.

Properties

Link copied to clipboard
val downloadListener: FileDownloadLargeFileListener
A listener will be used watch download status changes and update the overall download status.

Functions

Link copied to clipboard
Link copied to clipboard
open fun createDownloadRequestSet(requestConfig: RequestConfig, estimatedSize: Long, listener: DownloadManager.Listener): Observable<DownloadRequestSet>
Creates an empty download request set with the specified estimated size.
Link copied to clipboard
open fun deleteDownload(requestSet: DownloadRequestSet): Boolean
open fun deleteDownload(requestSetKey: Long): Boolean
Cancels all the download requests in the specified set and removes the download request set.
Link copied to clipboard
open fun enqueueDownload(requestSet: DownloadRequestSet, requests: Array<IDownloadManager.IRequest>): Observable<DownloadRequestSet>
Enqueues a set of download requests to the specified request set.
Link copied to clipboard
open fun getAllNotificationChannels(): List<NotificationChannel>
Get all of the notification channels assigned to this DownloadManager instance
Link copied to clipboard
open fun getDownloadStatus(requestSet: DownloadRequestSet): DownloadStatus
open fun getDownloadStatus(requestSetKey: Long): DownloadStatus
Queries the overall download status of the specified download request set.
Link copied to clipboard
open fun getInstance(context: Context): DownloadManager
Gets reference to the single instance of the default download manager.
Link copied to clipboard
open fun getNotificationChannelById(notificationChannelId: String): NotificationChannel
Retrieve the NotificationChannel specified by ID (or null if the NotificationChannel does not exist)
Link copied to clipboard
open fun pauseDownload(requestSet: DownloadRequestSet): DownloadStatus
open fun pauseDownload(requestSetKey: Long): DownloadStatus
Pauses download of the specified request set, if it is not already paused.
Link copied to clipboard
Link copied to clipboard
open fun removeNotificationChannelById(notificationChannelId: String)
Remove the NotificationChannel with the spedified ID from the NotificationManager
Link copied to clipboard
open fun resumeDownload(requestSet: DownloadRequestSet): DownloadStatus
open fun resumeDownload(requestSetKey: Long): DownloadStatus
Resumes download of the specified request set, if it is currently paused.
Link copied to clipboard
open fun setNotificationChannel(notificationChannel: NotificationChannel)
Set the specified NotificationChannel This is typically done when use of a customized NotificationChannel (for example, to manage Notification sound settings) is desired.