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
7
votes
4 answers

Multiple file download manager in listview +progress/pause/resume android

i need to make a dynamic download manager for my app in this form : adding new link to current list can pause and resume download deleting complete downloads from custom list like this at first i use this site code for thread downloading. then ,…
Saeid
  • 2,261
  • 4
  • 27
  • 59
7
votes
1 answer

Can't resume download

I want to download a big (zip) file from my server. It's about 440MB. I'm using android download service. Here is my code: DownloadManager dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE); Request request = new…
Rado Dr.
  • 425
  • 1
  • 3
  • 10
7
votes
3 answers

Unzipping files programmatically in Android

I am downloading a zip folder and saving in specific folder in my Android device. My application is not accessing the folder as it is zipped. I would like to unzip the folder after downloading from server and save in specific folder. And my code is…
7
votes
1 answer

Is it okay to Query the DownloadManager on the UI Thread?

The DownloadManager has a method query(). My question is if it's okay to call this method on the UI Thread, or if it should only be called from a background thread? Can calling it ever cause an ANR?
yydl
  • 24,284
  • 16
  • 65
  • 104
6
votes
2 answers

How can I save files downloaded from Download Manager in Android to app internal(filesDir) as now its not easy to access files in Android

Here is the code i am tring to do the same when i am downloading anything from webView in android. webview.setDownloadListener { url, userAgent, contentDisposition, mimetype, l -> val request =…
6
votes
3 answers

Using ProgressBar with DownloadManager

In my app, I use DownloadManager to download a file from Firebase. import static android.os.Environment.DIRECTORY_DOWNLOADS; public class Physics extends AppCompatActivity { PDFView pdfView; FirebaseStorage firebaseStorage; StorageReference…
6
votes
3 answers

Download Manager with Google Drive URL

I'm trying to download a file stored in Google Drive using android DownloadManager. I get the sign in token from Google like following: GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) …
MikeKeepsOnShine
  • 1,730
  • 4
  • 23
  • 35
6
votes
2 answers

java.lang.SecurityException: Unsupported path path/path/JPEG_5e3bbe8ed6c75_24741_.jpg

This is not working on Some Devices. In Samsung Device they not allow to download file using Download manager. I have already define permission in the manifest and also get RunTime Permission. DownloadManager downloadManager = (DownloadManager)…
Bhavin Parghi
  • 71
  • 2
  • 4
6
votes
2 answers

Android Download Manager "Download Unsuccessful"

This is my first time trying to implement DownloadManager and no matter what I try, I always get a notification saying "Download unsuccessful." I've looked at many other SO forums, a few tutorials, and what I have should work. Yes, I've set internet…
Ethan Shoe
  • 466
  • 1
  • 7
  • 20
6
votes
1 answer

DownloadManager not Showing Icon in Status Bar

My Download Manager is not showing a notification icon in the status bar. The notification is their when you open all notifications but the icon is absent in the status bar so people cant tell at a glance that the download has started. This isn't a…
6
votes
2 answers

Android Download Manager Path Appears to be invalid sometimes

Downloading through download Manager in android sometimes does not download and throw error path appears to be invalid and it corrects itself after sometime. This is very unusual behaviour of Android Download Manager . I am downloading to external…
gautam
  • 1,701
  • 2
  • 17
  • 33
6
votes
2 answers

Download Manger not working in Android Pie 9.0 NetworkSecurityConfig: No Network Security Config specified, using platform default

On updating the device OS to Android 9.0, previously this code was working fine(Xiaomi mi A2). Now, files are not being downloaded on Android Pie 9.0. Moreover it is working fine in Oreo, Nougat , Marshmallow Here is the code snippet: File myDir =…
6
votes
2 answers

Download Manager returns unsuccessful download on Android 9.0 NetworkSecurityConfig: No Network Security Config specified, using platform default

I am using Download Manager to download file from the internet. The download complete successfully in Android 6, 8.1, but not in Android 9.0 DownloadManager.Request request = new…
6
votes
1 answer

DownloadManager ERROR_CANNOT_RESUME, status Failed

I am using android.app.DownloadManager to download large files - (about 700mb), on android tv - 7.1.1. So when server is giving me files with speed 1mb/s everything is fine. But when speed is 500kb/s I cannot download file. Almost half of file…
Anton Kogan
  • 153
  • 2
  • 10
6
votes
1 answer

Where can I find DownloadManager's ContentProvider implementation

I've searched through android's open source code as much as I could and I haven't been able to find the implementation to the actual downloading via the DownloadManager in the 2.3 SDK. I have found the source for the DownloadManager and the source…
Pzanno
  • 2,185
  • 2
  • 20
  • 23