android.app
Class DownloadManager

java.lang.Object
  extended by android.app.DownloadManager

public class DownloadManager
extends Object


Nested Class Summary
static class DownloadManager.Query
           
static class DownloadManager.Request
           
 
Field Summary
static String ACTION_DOWNLOAD_COMPLETE
           
static String ACTION_NOTIFICATION_CLICKED
           
static String ACTION_VIEW_DOWNLOADS
           
static String COLUMN_BYTES_DOWNLOADED_SO_FAR
           
static String COLUMN_DESCRIPTION
           
static String COLUMN_ID
           
static String COLUMN_LAST_MODIFIED_TIMESTAMP
           
static String COLUMN_LOCAL_FILENAME
           
static String COLUMN_LOCAL_URI
           
static String COLUMN_MEDIA_TYPE
           
static String COLUMN_MEDIAPROVIDER_URI
           
static String COLUMN_REASON
           
static String COLUMN_STATUS
           
static String COLUMN_TITLE
           
static String COLUMN_TOTAL_SIZE_BYTES
           
static String COLUMN_URI
           
static int ERROR_CANNOT_RESUME
           
static int ERROR_DEVICE_NOT_FOUND
           
static int ERROR_FILE_ALREADY_EXISTS
           
static int ERROR_FILE_ERROR
           
static int ERROR_HTTP_DATA_ERROR
           
static int ERROR_INSUFFICIENT_SPACE
           
static int ERROR_TOO_MANY_REDIRECTS
           
static int ERROR_UNHANDLED_HTTP_CODE
           
static int ERROR_UNKNOWN
           
static String EXTRA_DOWNLOAD_ID
           
static String EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS
           
static String INTENT_EXTRAS_SORT_BY_SIZE
           
static int PAUSED_QUEUED_FOR_WIFI
           
static int PAUSED_UNKNOWN
           
static int PAUSED_WAITING_FOR_NETWORK
           
static int PAUSED_WAITING_TO_RETRY
           
static int STATUS_FAILED
           
static int STATUS_PAUSED
           
static int STATUS_PENDING
           
static int STATUS_RUNNING
           
static int STATUS_SUCCESSFUL
           
 
Method Summary
 long addCompletedDownload(String title, String description, boolean isMediaScannerScannable, String mimeType, String path, long length, boolean showNotification)
           
 long enqueue(DownloadManager.Request request)
           
static Long getMaxBytesOverMobile(Context context)
           
 String getMimeTypeForDownloadedFile(long id)
           
static Long getRecommendedMaxBytesOverMobile(Context context)
           
 Uri getUriForDownloadedFile(long id)
           
 ParcelFileDescriptor openDownloadedFile(long id)
           
 Cursor query(DownloadManager.Query query)
           
 int remove(long... ids)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLUMN_ID

public static final String COLUMN_ID
See Also:
Constant Field Values

COLUMN_TITLE

public static final String COLUMN_TITLE
See Also:
Constant Field Values

COLUMN_DESCRIPTION

public static final String COLUMN_DESCRIPTION
See Also:
Constant Field Values

COLUMN_URI

public static final String COLUMN_URI
See Also:
Constant Field Values

COLUMN_MEDIA_TYPE

public static final String COLUMN_MEDIA_TYPE
See Also:
Constant Field Values

COLUMN_TOTAL_SIZE_BYTES

public static final String COLUMN_TOTAL_SIZE_BYTES
See Also:
Constant Field Values

COLUMN_LOCAL_URI

public static final String COLUMN_LOCAL_URI
See Also:
Constant Field Values

COLUMN_LOCAL_FILENAME

public static final String COLUMN_LOCAL_FILENAME
See Also:
Constant Field Values

COLUMN_STATUS

public static final String COLUMN_STATUS
See Also:
Constant Field Values

COLUMN_REASON

public static final String COLUMN_REASON
See Also:
Constant Field Values

COLUMN_BYTES_DOWNLOADED_SO_FAR

public static final String COLUMN_BYTES_DOWNLOADED_SO_FAR
See Also:
Constant Field Values

COLUMN_LAST_MODIFIED_TIMESTAMP

public static final String COLUMN_LAST_MODIFIED_TIMESTAMP
See Also:
Constant Field Values

COLUMN_MEDIAPROVIDER_URI

public static final String COLUMN_MEDIAPROVIDER_URI
See Also:
Constant Field Values

STATUS_PENDING

public static final int STATUS_PENDING
See Also:
Constant Field Values

STATUS_RUNNING

public static final int STATUS_RUNNING
See Also:
Constant Field Values

STATUS_PAUSED

public static final int STATUS_PAUSED
See Also:
Constant Field Values

STATUS_SUCCESSFUL

public static final int STATUS_SUCCESSFUL
See Also:
Constant Field Values

STATUS_FAILED

public static final int STATUS_FAILED
See Also:
Constant Field Values

ERROR_UNKNOWN

public static final int ERROR_UNKNOWN
See Also:
Constant Field Values

ERROR_FILE_ERROR

public static final int ERROR_FILE_ERROR
See Also:
Constant Field Values

ERROR_UNHANDLED_HTTP_CODE

public static final int ERROR_UNHANDLED_HTTP_CODE
See Also:
Constant Field Values

ERROR_HTTP_DATA_ERROR

public static final int ERROR_HTTP_DATA_ERROR
See Also:
Constant Field Values

ERROR_TOO_MANY_REDIRECTS

public static final int ERROR_TOO_MANY_REDIRECTS
See Also:
Constant Field Values

ERROR_INSUFFICIENT_SPACE

public static final int ERROR_INSUFFICIENT_SPACE
See Also:
Constant Field Values

ERROR_DEVICE_NOT_FOUND

public static final int ERROR_DEVICE_NOT_FOUND
See Also:
Constant Field Values

ERROR_CANNOT_RESUME

public static final int ERROR_CANNOT_RESUME
See Also:
Constant Field Values

ERROR_FILE_ALREADY_EXISTS

public static final int ERROR_FILE_ALREADY_EXISTS
See Also:
Constant Field Values

PAUSED_WAITING_TO_RETRY

public static final int PAUSED_WAITING_TO_RETRY
See Also:
Constant Field Values

PAUSED_WAITING_FOR_NETWORK

public static final int PAUSED_WAITING_FOR_NETWORK
See Also:
Constant Field Values

PAUSED_QUEUED_FOR_WIFI

public static final int PAUSED_QUEUED_FOR_WIFI
See Also:
Constant Field Values

PAUSED_UNKNOWN

public static final int PAUSED_UNKNOWN
See Also:
Constant Field Values

ACTION_DOWNLOAD_COMPLETE

public static final String ACTION_DOWNLOAD_COMPLETE
See Also:
Constant Field Values

ACTION_NOTIFICATION_CLICKED

public static final String ACTION_NOTIFICATION_CLICKED
See Also:
Constant Field Values

ACTION_VIEW_DOWNLOADS

public static final String ACTION_VIEW_DOWNLOADS
See Also:
Constant Field Values

INTENT_EXTRAS_SORT_BY_SIZE

public static final String INTENT_EXTRAS_SORT_BY_SIZE
See Also:
Constant Field Values

EXTRA_DOWNLOAD_ID

public static final String EXTRA_DOWNLOAD_ID
See Also:
Constant Field Values

EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS

public static final String EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS
See Also:
Constant Field Values
Method Detail

enqueue

public long enqueue(DownloadManager.Request request)

remove

public int remove(long... ids)

query

public Cursor query(DownloadManager.Query query)

openDownloadedFile

public ParcelFileDescriptor openDownloadedFile(long id)
                                        throws FileNotFoundException
Throws:
FileNotFoundException

getUriForDownloadedFile

public Uri getUriForDownloadedFile(long id)

getMimeTypeForDownloadedFile

public String getMimeTypeForDownloadedFile(long id)

getMaxBytesOverMobile

public static Long getMaxBytesOverMobile(Context context)

getRecommendedMaxBytesOverMobile

public static Long getRecommendedMaxBytesOverMobile(Context context)

addCompletedDownload

public long addCompletedDownload(String title,
                                 String description,
                                 boolean isMediaScannerScannable,
                                 String mimeType,
                                 String path,
                                 long length,
                                 boolean showNotification)


Copyright © 2008-2012. All Rights Reserved.