Interface IDownloadManager.IRequest

All Known Implementing Classes:
AbstractDownloadRequest, DownloadManager.Request
Enclosing interface:
IDownloadManager

public static interface IDownloadManager.IRequest
Contract of a download request that can be submitted to the download manager.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static @interface 
    The list of possible visibility states.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the description of this download, to be displayed in notifications (if enabled)
    long
    Gets the estimated total size of the download as number of bytes.
    Gets the list of headers to the send in HTTP request.
    android.net.Uri
    Gets the local destination for the downloaded file.
    Gets the MIME content type of this download.
    int
    Specifies whether a system notification is posted by the download manager while this download is running or when it is completed.
    android.net.Uri
    Gets the URL to the remote file.
    Gets the title of this download, to be displayed in notifications (if enabled).
    boolean
    Specifies whether this download may proceed over a bluetooth network connection.
    boolean
    Specifies whether this download may proceed over a metered network connection.
    boolean
    Specifies whether this download may proceed over a mobile network connection.
    boolean
    Specifies whether this download may proceed over a roaming connection.
    boolean
    Specifies whether this download may proceed over a WIFI network connection.
    boolean
    Specifies whether the file to be downloaded should be marked as scannable by MediaScanner.
    boolean
    Gets whether this download should be displayed in the system's Downloads UI.
  • Method Details

    • getRemoteUri

      @NonNull android.net.Uri getRemoteUri()
      Gets the URL to the remote file.
      Returns:
      the URI to the remote file.
    • getLocalUri

      @Nullable android.net.Uri getLocalUri()
      Gets 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. If the value is null, the download file will be placed in the applications download directory.
      Returns:
      null or the URI to the local file.
    • getMimeType

      @Nullable String getMimeType()
      Gets the MIME content type of this download. This will override the content type declared in the server's response.
      Returns:
      null or the mime type string.
    • getHeaders

      @Nullable Map<String,String> getHeaders()
      Gets the list of headers to the send in HTTP request.
      Returns:
      null or a list of name/value pairs
    • getEstimatedSize

      long getEstimatedSize()
      Gets the estimated total size of the download as number of bytes.
      Returns:
      the estimated total size of the download as number of bytes.
    • getTitle

      @Nullable String getTitle()
      Gets 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.
      Returns:
      the download title to be displayed in the notification.
    • getDescription

      @Nullable String getDescription()
      Gets the description of this download, to be displayed in notifications (if enabled)
      Returns:
      the description of this download
    • isAllowScanningByMediaScanner

      boolean isAllowScanningByMediaScanner()
      Specifies whether the file to be downloaded should be marked as scannable by MediaScanner.
      Returns:
      true if the download file should be marked as scannable, otherwise false.
    • isAllowedOverMobile

      boolean isAllowedOverMobile()
      Specifies whether this download may proceed over a mobile network connection.
      Returns:
      true if the file can be download over mobile network connection, otherwise false.
    • isAllowedOverWifi

      boolean isAllowedOverWifi()
      Specifies whether this download may proceed over a WIFI network connection.
      Returns:
      true if the file can be download over WIFI network connection, otherwise false.
    • isAllowedOverBluetooth

      boolean isAllowedOverBluetooth()
      Specifies whether this download may proceed over a bluetooth network connection.
      Returns:
      true if the file can be download over bluetooth network connection, otherwise false.
    • isAllowedOverRoaming

      boolean isAllowedOverRoaming()
      Specifies whether this download may proceed over a roaming connection.
      Returns:
      true if the file can be download over roaming connection, otherwise false.
    • isAllowedOverMetered

      boolean isAllowedOverMetered()
      Specifies whether this download may proceed over a metered network connection.
      Returns:
      true if the file can be download over metered connection, otherwise false.
    • isVisibleInDownloadsUi

      boolean isVisibleInDownloadsUi()
      Gets whether this download should be displayed in the system's Downloads UI.
      Returns:
      true if the file should be visible in downloads UI, otherwise false.
    • getNotificationVisibility

      int getNotificationVisibility()
      Specifies whether a system notification is posted by the download manager while this download is running or when it is completed.
      Returns:
      the visibility constant.