Best code examples for Android DownloadManager class (android.app.DownloadManager)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android DownloadManager class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android DownloadManager examples from Open Source projects
This code example shows how to use the following methods: getMimeTypeForDownloadedFile, getUriForDownloadedFile
69:	Uri uri = manager.getUriForDownloadedFile(id); 
-
75:	launchIntent.setDataAndType(uri, manager.getMimeTypeForDownloadedFile(id)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getMimeTypeForDownloadedFile, getUriForDownloadedFile
69:	Uri uri = manager.getUriForDownloadedFile(id); 
-
75:	launchIntent.setDataAndType(uri, manager.getMimeTypeForDownloadedFile(id)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getMimeTypeForDownloadedFile, getUriForDownloadedFile, query
49:	Cursor cursor = downloadMgr.query( query ); 
-
57:	downloadMgr.getUriForDownloadedFile( this.downloadId ), 
58:	downloadMgr.getMimeTypeForDownloadedFile( this.downloadId )); 
Full Snippet Info
5
CodeRank
Examples using Android DownloadManager enqueue method:
This code example shows how to use the following methods: enqueue, setDestinationInExternalPublicDir
44:	Request request = new Request(Uri.parse(url)); 
45:	request.setDestinationInExternalPublicDir( 
-
47:	getDownloadManager().enqueue(request); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: enqueue
222:	manager.enqueue(request); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: enqueue
145:	mManager.enqueue(request); 
-
154:	mManager.enqueue(request); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getUriForDownloadedFile, query
140:	Uri uri = downloadManager.getUriForDownloadedFile(id); 
-
159:	Cursor c = downloadManager.query(query); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getMimeTypeForDownloadedFile, getUriForDownloadedFile
69:	Uri uri = manager.getUriForDownloadedFile(id); 
-
75:	launchIntent.setDataAndType(uri, manager.getMimeTypeForDownloadedFile(id)); 
Full Snippet Info
5
CodeRank
Examples using Android DownloadManager query method:
This code example shows how to use the following methods: query
84:	Cursor cursor = mManager.query(new DownloadManager.Query().setFilterById(mId)); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: query
152:	Cursor query = dl.query(new DownloadManager.Query() 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: query
47:	Cursor c = mManager.query(query); 
Full Snippet Info
4
CodeRank
Examples using Android DownloadManager remove method:
This code example shows how to use the following methods: remove
84:	dm.remove(prefs.getLong("otadownloadid", -1)); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: query, remove
157:	Cursor c = downloadManager.query(query); 
-
177:	downloadManager.remove(dmId); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: query, remove
49:	Cursor c = dm.query(q); 
-
54:	dm.remove(id); 
Full Snippet Info
4
CodeRank
Related Android DownloadManager Questions & Answers:
DownloadManager Class Overview
The download manager is a system service that handles long-running HTTP downloads. Clients may request that a URI be downloaded to a particular destination file. The download manager will conduct the download in the background, taking care of HTTP interactions and retrying downloads after failures or across connectivity changes and system reboots.

Instances of this class should be obtained through getSystemService(String) by passing DOWNLOAD_SERVICE. Apps that request downloads through this API should register a broadcast receiver for ACTION_NOTIFICATION_CLICKED to appropriately handle when the user clicks on a running download in a notification or from the downloads UI. Note that the applic...
Methods
  • query
    Query the download manager about downloads that have been requested.
  • remove
    Cancel downloads and remove them from the download manager.