android-download-manager

Android 8.0 DownloadManager not working in MOBILE DATA

馋奶兔 提交于 2019-12-08 00:51:54
问题 I Set this in download manager but it does not work even in WIFI: request.setAllowedNetworkTypes(DownloadManager.Request.NETWO‌​RK_WIFI | DownloadManager.Request.NETWORK_MOBILE) And This code below can work: BUT ONLY IN WIFI MODE so that It can NOT download using MOBILE data request.setAllowedNetworkTypes(DownloadManager.Request.NETWO‌​RK_WIFI) Is this a bug in Download Manager? 回答1: I have similar problem. But removing line of setAllowedNetworkTypes doesn't work. My problem can be reproduced

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

旧巷老猫 提交于 2019-12-07 03:24:03
问题 My app (targetSdk=25) has a broadcast receiver defined in the manifest as follows: <receiver android:name="my.package.DownloadManagerReceiver" android:exported="true"> <intent-filter> <action android:name="android.intent.action.DOWNLOAD_COMPLETE" /> </intent-filter> </receiver> My DownloadManagerReceiver is notified whenever Android's DownloadManager finishes downloading a file, so I can do some processing on the file that was downloaded. I'm working on migrating my app's targetSdk to 27

Downloaded files get deleted automatically

橙三吉。 提交于 2019-12-07 00:50:23
问题 In my app, there are a few files that users can download. The files get downloaded via the android download manager . But, since a few weeks now, hundreds of users have been complaining that their files automatically keep deleting every 8-12 days, without them even uninstalling the app. (There might be many more users who haven't bothered to complain about the same.) Now, there could be a number of user-specific reasons why that would happen on a few devices. But considering the huge number

can we open download folder via. intent?

狂风中的少年 提交于 2019-12-06 20:19:20
问题 Actually, I need to open the default Download folder from my application. Is it possible? If yes, then please provide some reference. I am able to get the path of Download folder with the help of: Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) Any help will be well appreciated. 回答1: You can show the recent downloads activity with the following Intent startActivity(new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS)); Available since API 9 回答2: Samsung solution:

How to download a PDF from a dynamic URL in a webview

心不动则不痛 提交于 2019-12-06 15:46:27
The URL to the PDF on the server is: https://xyz.abc.com/qwer/leterpdf?Key=43,1&AppId=9520&usecaseID=195 Not ending with .pdf extension. How do I download this in a WebView? Depending on the technology you are using on server side, you can download a file forcing it passing appropriate headers. Like i am using PHP in my case & do it like this- $filepath = "pdfs/android.pdf"; $length = filesize($filepath); header('Content-type: application/pdf'); header('Content-Disposition: inline; filename="android.pdf"'); header('Content-Transfer-Encoding: binary'); header('Accept-Ranges: bytes'); header(

File Download from Webview is not working in android, I am trying this way,

半腔热情 提交于 2019-12-06 15:43:23
Below is my Code for implementing a webview which opens a link which have tabular information on date selection and having three buttons in the bottom for downloading pdf, xls and doc file download works well in browser but in webview download is not happening! public class Reports_Visit_Statastics extends AppCompatActivity { WebView wb; String ReportsURL, title; @SuppressLint("SetJavaScriptEnabled") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.visit_statastics_reports); wb = (WebView) findViewById(webView); wb

How to stop the file download in android by using DownloadManager?

荒凉一梦 提交于 2019-12-06 14:06:17
I read the file from the SD card , and show on the Gridview. When I select the item from Gridview and get the position of item. I click the download button it will download the item. How to Stop the item download when I using the downloadManager ? The code is download button is like the following: FileNode file = mFileList.get(temp_position) ;//Get the item I have select from Gridview final String filename = file.mName.substring(file.mName.lastIndexOf("/") + 1) ; final String urlString = "http://" + mIp + file.mName ; String serviceString = Context.DOWNLOAD_SERVICE ; DownloadManager

Install apk after download with download manager and exit from app

依然范特西╮ 提交于 2019-12-06 06:31:38
问题 i have created an android app and from server if any new version had released it will automatically start downloading by using inbuilt 'download manager' . for auto install after finish the download i have created a broadcast receiver to inform that download has finished and completed and then i start to install it. it works fine during i stay in app and don't close it. but my problem is when i close the application . so after finishing the download i want to automatically install it. but i

Android Download Manager Issue in Samsung Tab GT-P3100

为君一笑 提交于 2019-12-06 06:29:06
问题 I am not able to download files using DownloadManager in the aforementioned device. The same code works for all other devices. The question is why is it not working only in this device. If it's a Samsung specific issue, is there a workaround for this? I have tried changing directories to which the download should happen but that didn't work either. Android OS: 4.1.2 Crash Logs: 09-24 15:48:34.298: E/ActivityThread(19843): Failed to find provider info for downloads 09-24 15:48:34.306: D

DownloadManager not storing Downloaded files in Download Folder

冷暖自知 提交于 2019-12-06 03:20:52
问题 Whenever i try to download any file through the code below dm = (DownloadManager) context.getSystemService(context.DOWNLOAD_SERVICE); request = new Request( Uri.parse(finalurl)); enqueue = dm.enqueue(request); BroadcastReceiver receiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals(action)) { long downloadId = intent.getLongExtra( DownloadManager.EXTRA