Questions tagged [android-download-manager]

A system service that handles long-running HTTP downloads in Android

From the API page:

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 application must have the INTERNET permission to use this class.

Useful links

994 questions
71
votes
6 answers

Android download manager completed

Small question about the download manager in android. It's the first time I'm working with it and have successfully downloaded multiple files and opened them. But my question is how do i check if the download completed. The situation is I download a…
Msmit1993
  • 1,710
  • 4
  • 21
  • 35
38
votes
3 answers

Unknown URL content://downloads/my_downloads

I'm using Download Manger to download some multimedia files and categorize them. I'm also using Crashlytics and this is an error I frequently get on different devices and versions of Android: java.lang.IllegalArgumentException: Unknown URL…
nekofar
  • 1,497
  • 1
  • 18
  • 25
38
votes
4 answers

How to Enable Android Download Manager

I'm using Android Download Manager to download list of files. Lately I came across a crash report saying Unknown java.lang.IllegalArgumentException: Unknown URL content://downloads/my_downloads Then later, I figured it out that the reason is…
33
votes
6 answers

How to Download File Using DownloadManager in API 29 or Android Q?

As I am new in Android Development, I am trying to simple App using DownloadManager. Here is the code public class MainActivity extends AppCompatActivity implements ActivityCompat.OnRequestPermissionsResultCallback{ Button btn; private long…
Bishal Imtiaz
  • 479
  • 1
  • 5
  • 10
27
votes
5 answers

Android DownloadManager get filename

In my app you can download some files. I used the Android DownloadManager class for downloading. After the download is completed, it should show me a message that the file was downloaded. The problem is, there could be 2,3 or 4 downloads at the same…
user1456060
24
votes
1 answer

How to download a file from a server and save it in specific folder in SD card in Android?

I have one requirement in my Android application. I need to download and save file in specific folder of SD card programmatically. I have developed source code, which is String DownloadUrl = "http://myexample.com/android/"; String fileName =…
22
votes
3 answers

can we open download folder via. intent?

Actually, I need to open the default Download folder from my application. Is it possible? If yes, then please provide some reference. I am able to get the path of Download folder with the help…
abhishek kumar gupta
  • 2,189
  • 6
  • 35
  • 56
22
votes
2 answers

Is it possible to cancel/stop a download started using DownloadManager?

I am using DownloadManager to download a bunch of files in my application. I am not able to figure out how to cancel the downloads which has been enqueued by downloadManager. There are two possibilities: a. User can manually cancel it say by…
PravinCG
  • 7,688
  • 3
  • 30
  • 55
21
votes
1 answer

I am getting IllegalArgumentException during picking a document file from download manager ,which is happening only for oreo

Here I am attaching the logs : Caused by: java.lang.IllegalArgumentException: Unknown URI: content://downloads/public_downloads/1587 at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:165) at…
21
votes
2 answers

How to get programmatically the data usage limit set by user on Android OS configuration?

User can define at Data Usage screen a limite and/or a warning limit for mobile data usage. So how can I get this information by code? Screen of Data Usage configuration of native OS. I wanna the limit value and warning value. I've already tried…
20
votes
4 answers

Download Manager Android Permissions error: write external Storage

I programmed an Android App that downloads a sample PDF file to the Download directory using DownloadManager. Here's the code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
20
votes
3 answers

Show Download Manager progress inside activity

I used Download Manager class inside my activity to perform downloads; it works fine and my next task is to show the same progress percentage inside my activity. I am not sure how to do it. My code so far public class DownloadSampleBook extends…
Aman Virk
  • 3,909
  • 8
  • 40
  • 51
19
votes
1 answer

DownloadManager.addCompletedDownload() deprecated on Android Q

On upgrading recently to API 29, my code: downloadManager.addCompletedDownload(downloadFilename, downloadFilename, true, saveInfo.mimeType, downloadPath, outputFile.length(), true) …now produces a deprecation warning: Warning:…
Stephen Talley
  • 1,130
  • 15
  • 15
18
votes
1 answer

FileProvider - Open File from Download Directory

I can't open any file from Download Folder. I can download a file and save in Download Folder with this: DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url)); request.setDescription(descricao); …
18
votes
2 answers

Till when android download manager will give status of a download by download reference Id?

I have a use case where, I started downloading a file using android download manager, and in the middle switched off mobile. When I restarted again, the download continued and completed. I got the status by giving the download reference id. But I…
1
2 3
66 67