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

Check If File Exists Before downloading the file

I am using download manager to download the file. The code for downloading the file is as follow. private String DownloadData(Uri uri, View v, String textview) { long downloadReference; // Create request for android download manager …
Manzoor Ahmad
  • 481
  • 6
  • 21
6
votes
2 answers

DownloadManager not working on android 8.0

DownloadManager does not work on Android 8.0. I don't know why. Can somebody help me? This is what I have tried: val downloadBroadcastReceiver = DownloadBroadcastReceiver() context.registerReceiver(downloadBroadcastReceiver,…
Zheng
  • 121
  • 1
  • 5
6
votes
2 answers

Can Download Manager save file in Internal storage in android?

I read somewhere that Download Manager in android can not save the file in the internal storage because Download Manager does not run in my app process, but in another process controlled by the system. Internal storage locations are permissions…
Maryam
  • 883
  • 10
  • 24
6
votes
1 answer

why IllegalArgumentException happens in using DownloadManager?

I used DownloadManager in my android project to download a file. DownloadManager.Request request = new DownloadManager.Request(Uri.parse(soundURL)); request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_HIDDEN); …
Maryam
  • 883
  • 10
  • 24
6
votes
1 answer

Open a Downloaded file (pdf) from the Downloads folder in the INTERNAL STORAGE

I have downloaded a file (133465.pdf) using the Download manager and now it is stored in the Downloads folder of the mobile phone (Internal storage). How should i try and retrieve the downloaded pdf from the Downloads folder? I am using the below…
6
votes
0 answers

java.lang.SecurityException: Requesting code from com.android.providers.downloads to be run in process my.package

The error appears in RecyclerView Adapter on different versions of android and devices. Im retrieving information about download progress every second and show percents on item layout. @Override public void onBindViewHolder(final ItemViewHolder…
6
votes
4 answers

Download File with android download manager and save in application folder

How can I download some files from my web server in my android application and store them in application folder in root location or in a private folder in internal/external memory. I can download files but i can't store them in private…
FarshidABZ
  • 3,860
  • 4
  • 32
  • 63
6
votes
4 answers

DownloadManager download completed but file not stored

I experienced strange problem with DownloadManager, download was successful but the file was not stored. So this is my code: try { DownloadManager manager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE); …
6
votes
3 answers

Android 6 get path to downloaded file

I our app (Xamarin C#) we download files from a server. At the end of a succeful download we get the URI to the newly-downloaded file and from the URI we get the file path: Android.Net.Uri uri =…
user1523271
  • 1,005
  • 2
  • 13
  • 27
6
votes
4 answers

DownloadManager doesn't start to download file

Imagine that i want to download this file (random file): http://www.analysis.im/uploads/seminar/pdf-sample.pdf This is my code: DownloadManager.Request req = new…
Giorgio Antonioli
  • 15,771
  • 10
  • 45
  • 70
6
votes
3 answers

Async task versus service to download data

I want to know which is better to download files, async task or service? My app has eight buttons, which one starts one direfferent download (which download has ~10MB). When the user clicks on one button or more to download data is better to use…
6
votes
1 answer

Best way to download a file in an Android app

I try to understand the pros and cons of different ways to download a file using an android app. I found several ways: Managing the download on my own (see this code snippet) Using Android's DownloadManager Downloading a file using OKHttp as…
dors
  • 5,802
  • 8
  • 45
  • 71
6
votes
1 answer

Android apk expansion file - optional

Can I use main expansion file as optional download option in application? So I don't need download it with APK file but later when user would do it.
Roman Barzyczak
  • 3,785
  • 1
  • 30
  • 44
6
votes
3 answers

can't open file downloaded through download manager api

I successfully downloaded a pdf file using DownloadManager API in android. Manifest permissions are set correctly. File downloaded correctly. But when it is tried to open it says "can't open file". Please help to open the downloaded file. I guess I…
Kalyan Dechiraju
  • 1,219
  • 1
  • 11
  • 29
6
votes
1 answer

Hide downloads from download manager android

I am implementing a mp3 downloader for android. I am using native DownloadManager service. Obviously, when I download a file, it also shows the downloading(or downloaded) file in the Download Manager app. I want to hide the downloaded file from…
berserk
  • 2,690
  • 3
  • 32
  • 63