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
11
votes
3 answers

How to download files from webview Android?

My code below loads the url page fine and after searching for a song when I click on the download link it crashes. There aren't so much tutorials on how to get the download manager to work with a webview. What am I doing wrong? import…
Dritan Berna
  • 171
  • 1
  • 3
  • 12
10
votes
4 answers

DownloadManager not working for Android 10 (Q)

I've been beating my head against this issue for quite awhile... I am updating an app that uses DownloadManger to do a simple task like downloading a file to the external storage public directory…
10
votes
1 answer

DownloadManager requests delayed on Android Pie

I have been using the DownloadManager APIs to handle downloads in one app for about 3 years. Recently I had some users on Android Pie complaining that sometimes downloads get stuck for several minutes before actually starting, thus compromising the…
10
votes
2 answers

How to download m3u8 format media file in Android

I need to parse an m3u8 media file, which is a playlist, and download the actual media content. As per my understanding, the following are the process involved: Parse the m3u8 file and get the '.TS' chunks Once all the chunks has been retrieved,…
Nizam
  • 5,698
  • 9
  • 45
  • 57
10
votes
3 answers

Android saving file to external storage without adding write permission?

Can we write data to external storage without adding write permission in the manifest ? Does Storage access Framework or Download manager gives any support for this?
shekar
  • 1,251
  • 4
  • 22
  • 31
10
votes
1 answer

DownloadManager IllegalStateException creating a download in DIRECTORY_DOWNLOADS

Firstly, there are a lot of questions on this subject, but none reflect my issue. I have for example read this and this. The issue that I have, is that in an extremely small number of cases, my function to setDestinationInExternalPublicDir results…
Knossos
  • 15,802
  • 10
  • 54
  • 91
10
votes
5 answers

Get file name from headers with DownloadManager in Android

I'm using DownloadManager to download video files from a url. The problem is if I use the default folder to download the file I can not see the video in the galery. Also, If I try to use this…
rodeleon
  • 362
  • 3
  • 18
9
votes
1 answer

How to show downloading progress Exoplayer

I am trying to download a video for offline in exoplayer, I want to show downloading progress inside an activity. How can I bind to the DownloadService in exoplayer. so that I can update the current downloading progress in an activity? I try to…
Jeeva
  • 3,975
  • 3
  • 23
  • 47
9
votes
1 answer

Why doesn't require WRITE_EXTERNAL_STORAGE on Android Q and higher

I use DownloadManager to download a photo and save it to external pictures directory: .setDestinationInExternalPublicDir(Environment.DIRECTORY_PICTURES, File.separator + filename) Marshmallow requires WRITE_EXTERNAL_STORAGE (as expected) but on…
9
votes
1 answer

Is android.intent.action.DOWNLOAD_COMPLETE an explicit broadcast?

My app (targetSdk=25) has a broadcast receiver defined in the manifest as follows:
9
votes
1 answer

Why are https downloads pausing with PAUSED_WAITING_TO_RETRY?

I'm using the DownloadManager service in Android to download files over https URLs, such as https://www.antennahouse.com/XSLsample/pdf/sample-link_1.pdf. The files are not (currently) password protected, in case that makes any difference. Once I…
LarsH
  • 27,481
  • 8
  • 94
  • 152
9
votes
1 answer

Cancel download in DownloadManager

I am trying to download images from an URL using the following code :- public static void writeToDisk(Context context, @NonNull String imageUrl, @NonNull String downloadSubfolder) { Uri imageUri = Uri.parse(imageUrl); String fileName =…
Abhriya Roy
  • 1,338
  • 17
  • 23
9
votes
3 answers

DownloadManager doesn't send broadcast after INSUFFICIENT_SPACE_ERROR

The problem If the cache directory is full, trying to execute a simple request will fail without sending the DownloadManager.ACTION_DOWNLOAD_COMPLETE broadcast. Note: The problem is general but can be mostly reproduced on low-end devices with…
Alex.F
  • 5,648
  • 3
  • 39
  • 63
9
votes
1 answer

Getting message when downloading has been completed

I'm trying to use android default download manager in my app, but problem is that i don't get any message in my app when download has been completed. Is there any way to solve this problem?
besam
  • 155
  • 6
9
votes
2 answers

Android - DownloadManager / BroadcastReceiver called multiple times

I am using a DownloadManager to handle a download in my application, I would like to notify the user when the download is completed. I am using the folowing code that is working well public void downloaddownload(View v){ View v2 = (View)…
1 2
3
66 67