download-manager

DownloadManager.Request.setNotificationVisibility fails with jSecurityException: invalid value for visibility: 1

社会主义新天地 提交于 2019-12-01 16:49:24
I am trying to use the DownloadManager to download large PDF files from my app. I want notifications to be displayed during the download as well as when the download finishes. However setting the visibility causes above exception. This error is different from this post DownloadManager.Request.setNotificationVisibility fails with jSecurityException: invalid value for visibility: 2 The other post is asking for help when setting the visibility to VISIBILITY_HIDDEN for which you need permission in the manifest. I am trying to set the visibility to DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY

DownloadManager.Request.setNotificationVisibility fails with jSecurityException: invalid value for visibility: 1

随声附和 提交于 2019-12-01 15:41:44
问题 I am trying to use the DownloadManager to download large PDF files from my app. I want notifications to be displayed during the download as well as when the download finishes. However setting the visibility causes above exception. This error is different from this post DownloadManager.Request.setNotificationVisibility fails with jSecurityException: invalid value for visibility: 2 The other post is asking for help when setting the visibility to VISIBILITY_HIDDEN for which you need permission

DownloadManager sends STATUS_SUCCESSFUL for failed download

时光总嘲笑我的痴心妄想 提交于 2019-12-01 15:28:17
问题 Okay, I'm downloading files (images). I want to send a message with local URI for the image when the download is completed. But 20% of time I'm getting this: 6-01 18:46:39.900: INFO/DownloadManager(412): Initiating request for download 605 06-01 18:46:39.910: WARN/DownloadManager(412): Aborting request for download 605: Trying to resume a download that can't be resumed 06-01 18:46:39.910: INFO/ololo(2826): Okay, I'll broadcast. 06-01 18:46:39.990: WARN/ImageView(2826): Unable to open content:

Android DownloadManager and SSL (https)

北慕城南 提交于 2019-11-30 08:16:48
Oh, great. There's always something else that some... Grrr... Anyway, so I worked days and days wading through vague, incomplete, and contradictory Picasa information so that my Android app could find a Picasa picture and download it using the download manager. So just now I made the finishing touches and hit the "run" button. Everything went fine until DownloadManager tried to download the file: java.lang.IllegalArgumentException: Can only download HTTP URIs: https://example.com/image.jpg Tell me you're joking. Tell me they didn't make a download manager that can't handle SSL... Better yet,

Android ProgressBar in ListView while using DownloadManager

℡╲_俬逩灬. 提交于 2019-11-30 07:24:39
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, spinning wheel style, to appear next to each item of the list while the file is downloaded. My problem is : I can't find how to make the spinning wheel appear. Before the Download Manager I tried it with an AsyncTask and the spinning wheel worked. Here is my code : CategoryActivity.java (Activity of the ListView) @Override public void onItemClick

What's a .sh file?

三世轮回 提交于 2019-11-29 18:51:29
So I am not experienced in dealing with a plethora of file types, and I haven't been able to find much info on exactly what .sh files are. Here's what I'm trying to do: I'm trying to download map data sets which are arranged in tiles that can be downloaded individually: http://daymet.ornl.gov/gridded In order to download a range of tiles at once, they say to download their script, which eventually leads to daymet-nc-retrieval.sh : https://github.com/daymet/scripts/blob/master/Bash/daymet-nc-retrieval.sh So, what exactly am I supposed to do with this code? The website doesn't provide further

Download .apk with DownloadManager

心不动则不痛 提交于 2019-11-29 15:32:48
问题 Hi I'm facing a little problem here. For updates of my App (that isn't available in Play Store) I download it via DownloadManager to the Donwload directoryof the device. The .apk file is on a ftp server. After downloading I pop up a dialog if the user wants to install the update (not malicious or something, no root needed). Everything works fine except the user cancels this dialog and wants to "manually" install the apk by clicking on the downloaded file in the Download diretory. If so, I don

Android DownloadManager and SSL (https)

独自空忆成欢 提交于 2019-11-29 11:21:13
问题 Oh, great. There's always something else that some... Grrr... Anyway, so I worked days and days wading through vague, incomplete, and contradictory Picasa information so that my Android app could find a Picasa picture and download it using the download manager. So just now I made the finishing touches and hit the "run" button. Everything went fine until DownloadManager tried to download the file: java.lang.IllegalArgumentException: Can only download HTTP URIs: https://example.com/image.jpg

Android ProgressBar in ListView while using DownloadManager

点点圈 提交于 2019-11-29 09:34:12
问题 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, spinning wheel style, to appear next to each item of the list while the file is downloaded. My problem is : I can't find how to make the spinning wheel appear. Before the Download Manager I tried it with an AsyncTask and the spinning wheel worked. Here

Retrieve file path from caught DownloadManager intent

只谈情不闲聊 提交于 2019-11-29 03:54:45
Since Android 4.2 if a user downloads some file in the browser the DownloadManager is used. If the user clicks the 'download complete' notification an Intent is and was always launched. Before Android 4.2 the intent used to have the downloaded file's path in the content, such that: intent.getData() would return a String such as file:///storage/emulated/0/Download/some_file.ext . However, since Android 4.2 the download manager broadcasts and intent with a content scheme, such as content://downloads/all_downloads/2334 . How do I retrieve the local file path for a downloaded file? I've tried the