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
9
votes
1 answer

Control the download ordering of Download manager in android

have an use case like the following: There are several files to download e.g. A B C D E F When the downloading is started , say the A B is finished and C is downloading, I would like to interrupt the download of C and start the download of E Then,…
user782104
  • 13,233
  • 55
  • 172
  • 312
9
votes
3 answers

Downloaded files not appearing in the Downloads App in android

I am building an application in android where users can download remote files and save them to the external storage downloads directory. It works well and I am able to view files through Es File Explorer and other file explorer tools. But those…
Vivek
  • 1,823
  • 1
  • 19
  • 39
9
votes
3 answers

BroadcastReceiver onReceive() getting called twice

In my app, I am using DownloadManager, for downloading PDF's, which notifies the application via a BroadcastReceiver once the download is completed. My problem is the onReceive() method of BroadcastReceiver is getting called twice. The code is as…
andro
  • 977
  • 1
  • 10
  • 21
8
votes
0 answers

How to use DownloadManager on Android 10?

I want to use DownloadManager on Android 10 to download files, and a download progress notification bar will appear. I use the following code, which can be used normally on devices under Android 9 but not on Android 10 emulator (no error exception…
arcns
  • 184
  • 7
8
votes
1 answer

Download manager does not work on LG devices

I try to perform downloading the file using DownloadManager. Everything works fine except LG devices. Here is my code: private void downloadFile(FileInfo fileInfo) { private DownloadManager manager = (DownloadManager) MyApp.getSingleton(). …
Nisazh
  • 306
  • 1
  • 7
8
votes
1 answer

Open a downloaded file after downloading in Android

I have an app with some links to files on the web. I want that after the user choose to download a file to the device - the file will be opened automatically. This is my code for downloading: private void downloadFile(String url) { if…
TamarG
  • 3,522
  • 12
  • 44
  • 74
8
votes
1 answer

Download Files Using download manager

I am downloading files from server using DownloadManager class Here is what i am doing public void downloadPdf(String url, String sem, String title, String branch) { Uri Download_Uri = Uri.parse(url); DownloadManager.Request request = new…
Android
  • 1,085
  • 4
  • 13
  • 28
8
votes
1 answer

DownloadManager: understand retry policy and error codes

According to the documentation, if download is failed due to http error - the COLUMN_REASON should hold the specific http error code. the problem I'm having is that in practice, the only reason value I see when download fail is ERROR_HTTP_DATA_ERROR…
Tal Kanel
  • 10,475
  • 10
  • 60
  • 98
8
votes
3 answers

Can we have Custom Notification for android.os.DownloadManager?

Currently I am using below code snippet to download a file using DownloadManager: String servicestring = Context.DOWNLOAD_SERVICE; DownloadManager downloadmanager; downloadmanager = (DownloadManager)…
Vikasdeep Singh
  • 20,983
  • 15
  • 78
  • 104
8
votes
4 answers

How to get file name when clicking on URL in webview

How to get the file name which we uploaded on server when we provide linked for that file in page? What I am doing is, I am providing data with file link in webview so whenever user click on link need to download from server as I have download this…
Pratik
  • 30,639
  • 18
  • 84
  • 159
7
votes
1 answer

Download does not start on Android 9 when requesting a download from WLAN with no internet

A am working on an Android app which connects to a local flask server using WiFi. Then, the app displays images which are stored on the server (RPi3). A click on an image triggers a download request and I want the Android DownloadManager to enqueue…
7
votes
4 answers

Download Manager not working

I'm trying to develop app that show videos and you can Download it i'm using Download Manager class but it didn't work, also it didn't give me any error :( this is my download manager code: public void downloadFileFromUrl(String url, String…
M.Honi
  • 123
  • 1
  • 1
  • 12
7
votes
3 answers

Caused by: java.lang.IllegalStateException: Unable to create directory in Android 6.0 devices

I have to store the download the image from the url using DownloadManager and store it into the sdcard with my own directory like "xyz". This is my code File img_directory = null; img_directory = new File(Environment.getExternalStorageDirectory() +…
malavika
  • 1,331
  • 4
  • 21
  • 54
7
votes
3 answers

Android ProgressBar in ListView while using DownloadManager

I have a ListView in which each item represents a PDF file. When the user clicks on an item, the application must download the file on external storage. Now the download doesn't work properly, but that's not the question. I want a ProgressBar,…
7
votes
4 answers

DownloadManager not storing Downloaded files in Download Folder

Whenever i try to download any file through the code below dm = (DownloadManager) context.getSystemService(context.DOWNLOAD_SERVICE); request = new Request( Uri.parse(finalurl)); enqueue = dm.enqueue(request); BroadcastReceiver receiver = new…
architjn
  • 1,397
  • 2
  • 13
  • 30