java.lang.Object | |
↳ | android.app.DownloadManager.Request |
This class contains all the information necessary to request a new download. The URI is the
only required parameter.
Note that the default download destination is a shared volume where the system might delete
your file if it needs to reclaim space for system use. If this is a problem, use a location
on external storage (see setDestinationUri(Uri)
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | NETWORK_MOBILE | Bit flag for setAllowedNetworkTypes(int) corresponding to
TYPE_MOBILE . |
|||||||||
int | NETWORK_WIFI | Bit flag for setAllowedNetworkTypes(int) corresponding to
TYPE_WIFI . |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add an HTTP header to be included with the download request.
| |||||||||||
Restrict the types of networks over which this download may proceed.
| |||||||||||
Set whether this download may proceed over a roaming connection.
| |||||||||||
Set a description of this download, to be displayed in notifications (if enabled)
| |||||||||||
Set the local destination for the downloaded file to a path within the application's
external files directory (as returned by
getExternalFilesDir(String) . | |||||||||||
Set the local destination for the downloaded file to a path within the public external
storage directory (as returned by
getExternalStoragePublicDirectory(String) . | |||||||||||
Set the local destination for the downloaded file.
| |||||||||||
Set the MIME content type of this download.
| |||||||||||
Control whether a system notification is posted by the download manager while this
download is running.
| |||||||||||
Set the title of this download, to be displayed in notifications (if enabled).
| |||||||||||
Set whether this download should be displayed in the system's Downloads UI.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Bit flag for setAllowedNetworkTypes(int)
corresponding to
TYPE_MOBILE
.
Bit flag for setAllowedNetworkTypes(int)
corresponding to
TYPE_WIFI
.
uri | the HTTP URI to download. |
---|
Add an HTTP header to be included with the download request. The header will be added to the end of the list.
header | HTTP header name |
---|---|
value | header value |
Restrict the types of networks over which this download may proceed. By default, all network types are allowed.
flags | any combination of the NETWORK_* bit flags. |
---|
Set whether this download may proceed over a roaming connection. By default, roaming is allowed.
allowed | whether to allow a roaming connection to be used |
---|
Set a description of this download, to be displayed in notifications (if enabled)
Set the local destination for the downloaded file to a path within the application's
external files directory (as returned by getExternalFilesDir(String)
.
context | the Context to use in determining the external files directory |
---|---|
dirType | the directory type to pass to getExternalFilesDir(String) |
subPath | the path within the external directory, including the destination filename |
Set the local destination for the downloaded file to a path within the public external
storage directory (as returned by
getExternalStoragePublicDirectory(String)
.
dirType | the directory type to pass to
getExternalStoragePublicDirectory(String) |
---|---|
subPath | the path within the external directory, including the destination filename |
Set the local destination for the downloaded file. Must be a file URI to a path on external storage, and the calling application must have the WRITE_EXTERNAL_STORAGE permission. By default, downloads are saved to a generated filename in the shared download cache and may be deleted by the system at any time to reclaim space.
Set the MIME content type of this download. This will override the content type declared in the server's response.
Control whether a system notification is posted by the download manager while this
download is running. If enabled, the download manager posts notifications about downloads
through the system NotificationManager
. By default, a notification is
shown.
If set to false, this requires the permission
android.permission.DOWNLOAD_WITHOUT_NOTIFICATION.
show | whether the download manager should show a notification for this download. |
---|
Set the title of this download, to be displayed in notifications (if enabled). If no title is given, a default one will be assigned based on the download filename, once the download starts.
Set whether this download should be displayed in the system's Downloads UI. True by default.
isVisible | whether to display this download in the Downloads UI |
---|