public class DownloadManagerPro
extends java.lang.Object
getStatusById(long)
get download statusgetDownloadBytes(long)
get downloaded byte, total bytegetBytesAndStatus(long)
get downloaded byte, total byte and download statusgetFileName(long)
get download file namegetUri(long)
get download urigetReason(long)
get failed code or paused reasongetPausedReason(long)
get paused reasongetErrorCode(long)
get failed error codeisExistPauseAndResumeMethod()
whether exist pauseDownload and resumeDownload method in
DownloadManager
pauseDownload(long...)
pause download. need pauseDownload(long...) method in DownloadManager
resumeDownload(long...)
resume download. need resumeDownload(long...) method in DownloadManager
DownloadManagerPro.RequestPro.setNotiClass(String)
set noti classDownloadManagerPro.RequestPro.setNotiExtras(String)
set noti extrasModifier and Type | Class and Description |
---|---|
static class |
DownloadManagerPro.RequestPro |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COLUMN_LOCAL_FILENAME
represents downloaded file above api 11
|
static java.lang.String |
COLUMN_LOCAL_URI
represents downloaded file below api 11
|
static Uri |
CONTENT_URI |
static java.lang.String |
METHOD_NAME_PAUSE_DOWNLOAD |
static java.lang.String |
METHOD_NAME_RESUME_DOWNLOAD |
Constructor and Description |
---|
DownloadManagerPro(DownloadManager downloadManager) |
Modifier and Type | Method and Description |
---|---|
int[] |
getBytesAndStatus(long downloadId)
get downloaded byte, total byte and download status
|
int[] |
getDownloadBytes(long downloadId)
get downloaded byte, total byte
|
int |
getErrorCode(long downloadId)
get failed error code
|
java.lang.String |
getFileName(long downloadId)
get download file name
|
int |
getPausedReason(long downloadId)
get paused reason
|
int |
getReason(long downloadId)
get failed code or paused reason
|
int |
getStatusById(long downloadId)
get download status
|
java.lang.String |
getUri(long downloadId)
get download uri
|
static boolean |
isExistPauseAndResumeMethod()
whether exist pauseDownload and resumeDownload method in
DownloadManager |
int |
pauseDownload(long... ids)
pause download
|
int |
resumeDownload(long... ids)
resume download
|
public static final Uri CONTENT_URI
public static final java.lang.String COLUMN_LOCAL_FILENAME
public static final java.lang.String COLUMN_LOCAL_URI
public static final java.lang.String METHOD_NAME_PAUSE_DOWNLOAD
public static final java.lang.String METHOD_NAME_RESUME_DOWNLOAD
public int getStatusById(long downloadId)
downloadId
- public int[] getDownloadBytes(long downloadId)
downloadId
- public int[] getBytesAndStatus(long downloadId)
downloadId
- public int pauseDownload(long... ids)
ids
- the IDs of the downloads to be pausedpublic int resumeDownload(long... ids)
ids
- the IDs of the downloads to be resumedpublic static boolean isExistPauseAndResumeMethod()
DownloadManager
public java.lang.String getFileName(long downloadId)
downloadId
- public java.lang.String getUri(long downloadId)
downloadId
- public int getReason(long downloadId)
downloadId
- DownloadManager#STATUS_PAUSED
, return getPausedReason(long)
DownloadManager#STATUS_FAILED
, return getErrorCode(long)
DownloadManager#STATUS_PAUSED
nor
DownloadManager#STATUS_FAILED
, return 0public int getPausedReason(long downloadId)
downloadId
- DownloadManager#STATUS_PAUSED
, return one of
DownloadManager#PAUSED_WAITING_TO_RETRY
DownloadManager#PAUSED_WAITING_FOR_NETWORK
DownloadManager#PAUSED_QUEUED_FOR_WIFI
DownloadManager#PAUSED_UNKNOWN
DownloadManager#PAUSED_UNKNOWN
public int getErrorCode(long downloadId)
downloadId
- DownloadManager#ERROR_*