download-manager

Manually add local file to the Downloads app

邮差的信 提交于 2020-01-22 20:04:06
问题 My app needs to download files, I was looking into DownloadManager, however it has some limitations that don't suit my case (authentication, naming scheme, verification), so I made my custom download engine. Is it possible to manually add a file downloaded with my engine (thus by using a local URL) to the list in the Downloads system app? My understanding is that list is populated by a system content provider. Is it possible to add records to it, without the DownloadManager trying to download

Cancelling ongoing download does not remove notification

↘锁芯ラ 提交于 2020-01-15 03:30:11
问题 I am using Android DownloadManager, and have the ability to cancel ongoing download. This call also removes download progress from notification bar on all device I tested but from Nexus 5(running Android 5.0.1). Behavior is download is canceled but notification is not and get stuck at percentage complete when cancel was requested. Here is how I set request object to display notification DownloadManager.Request.setNotificationVisibility(Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); And this is

Pause/Resume http connection download

孤街浪徒 提交于 2019-12-29 05:27:26
问题 I want to be able to open a http connection to a given file in Android and start downloading it. I also have to be able to pause the download at some point and resume it later. How is this achieved in Android? I don't want to start the download all over again. 回答1: Such a downloader has been posted here: HttpURLConnection connection = (HttpURLConnection) url.openConnection(); if(ISSUE_DOWNLOAD_STATUS.intValue()==ECMConstant.ECM_DOWNLOADING){ File file=new File(DESTINATION_PATH); if(file

How to override download process in Chrome Extension

半世苍凉 提交于 2019-12-25 10:02:25
问题 I am trying to make a download manager extension in chrome browser. I can monitor chrome downloads via chrome.downloads API. But, I want to override the download process and handle download destination with my extension instead of default "saveFileDialog". Is there any way to do so? 回答1: Many download managers are available from the store, so it is possible. Some of them are open-source and available on github, so have a look before starting your own. If you want to replaces the default

How to override download process in Chrome Extension

有些话、适合烂在心里 提交于 2019-12-25 10:00:18
问题 I am trying to make a download manager extension in chrome browser. I can monitor chrome downloads via chrome.downloads API. But, I want to override the download process and handle download destination with my extension instead of default "saveFileDialog". Is there any way to do so? 回答1: Many download managers are available from the store, so it is possible. Some of them are open-source and available on github, so have a look before starting your own. If you want to replaces the default

download file to custom directory

陌路散爱 提交于 2019-12-23 07:40:36
问题 I am using the DownloadManager to download a file to my Android device. I can choose to download to the DCIM, Downloads, Picutures folder, etc using: downloadRequest.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, "file.jpg"); This works. But I can only choose a limit set of folders to download to. I want to download to the root of my sdcard using /sdcard/ I tried: downloadRequest.setDestinationUri(Uri.fromFile(new File("/sdcard/file.jpg"))); But this renders the following

download file to custom directory

删除回忆录丶 提交于 2019-12-23 07:40:10
问题 I am using the DownloadManager to download a file to my Android device. I can choose to download to the DCIM, Downloads, Picutures folder, etc using: downloadRequest.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, "file.jpg"); This works. But I can only choose a limit set of folders to download to. I want to download to the root of my sdcard using /sdcard/ I tried: downloadRequest.setDestinationUri(Uri.fromFile(new File("/sdcard/file.jpg"))); But this renders the following

How to add download links to IDM from a program [closed]

人走茶凉 提交于 2019-12-23 06:20:19
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . I want to add some links to the IDM. can anyone give me a pseudo code for doing that. or a link to a page that explains how to do it. 回答1: You may start IDM from the command line using the following parameters idman /s or idman /d URL [/p local_path] [/f local_file_name] [/q] [/h][

How to download files in webview..?

雨燕双飞 提交于 2019-12-23 02:56:24
问题 My app would open browser to download files,but I want it to download in webview(Don't open browser to download). I'm not good at app,plz give me complete codes as you can. using System; using Android.App; using Android.Content; using Android.Runtime; using Android.Views; using Android.Widget; using Android.OS; using Android.Webkit; using System.Net; namespace REC { [Activity(Label = "ABC", MainLauncher = true, Icon = "@drawable/rec512", ConfigurationChanges = Android.Content.PM.ConfigChanges

Android DownloadManager remove() - how to determine when the remove() operation finishes?

醉酒当歌 提交于 2019-12-23 02:02:29
问题 Is there an easy mechanism to determine when a DownloadManager remove() has completed, as it appears to be partially asynchronous. The function returns almost instantaneously with a count of the entries in the Download table it's deleted, but the actual filesystem housekeeping appears to be pushed into some background thread. Issue is I've written a little bit of code that looks for and deletes any existing DownloadManager entry for file X (and hopefully the filesystem object), before pulling