android-download-manager

How do i download files to the local downloads folder?

江枫思渺然 提交于 2021-02-20 04:55:07
问题 I enabled the download settings for files with WebView. I'm saving files with DownloadManager. But the files do not appear in the local downloads directory. The files I've downloaded are save here. > file/storage/emulated/0/Android/data/com.myapp/files/x.mp3 I've tried a lot. But somehow it was not downloaded in the local downloads folder. What should I do? My Code String string = String.valueOf((URLUtil.guessFileName(url, contentDisposition, mimeType))); DownloadManager.Request request = new

DownloadManager not working for Android 10 (Q)

喜夏-厌秋 提交于 2021-02-18 06:34:07
问题 I've been beating my head against this issue for quite awhile... I am updating an app that uses DownloadManger to do a simple task like downloading a file to the external storage public directory i.e: Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) Everything works fine here from Android api 19-28. Its when testing on API 29 (Q/10) is where issues occur. Android implemented scoped storage and so deprecated the getExternalStoragePublicDirectory... As a result I

download video file using webview

会有一股神秘感。 提交于 2021-02-11 17:43:31
问题 i am trying to download video file using web view on click button when i click on button it start download but when i check on file manager there is nothing inside it. this is my url http://segoma.com/v.php?type=view&id=U5K8Q4F6DD which i have to download video. so help me to solve this issue. i have also check many ways using webview download but doesn't help me. i have try following code. public class TestActivity extends Activity { WebView webView; String image_url; @SuppressLint(

Android intent-filter to be notified of an attempt to view a CSV file in the Download Manager

风格不统一 提交于 2020-08-02 05:13:28
问题 What's the required magic incantation to register your app to be notified that a user is trying to view a CSV file they've previously downloaded via the Download manager . I've had a brief play and the following filter will happily intercept notifications generated by: Dropbox, Box, Google Drive, Sky Drive, Chrome..... and offer itself to open the files, but my App isn't getting anything when a user attempts to view a file via the Download Manager. <intent-filter> <action android:name="com.my

Android : How to pause and resume using DownloadManager?

时间秒杀一切 提交于 2020-07-19 08:10:46
问题 this is my code and i want to add resumable feature but i couldn't is it posible? downloadManager = (DownloadManager)getSystemService(DOWNLOAD_SERVICE); Uri Download_Uri = Uri.parse("http://download.thinkbroadband.com/20MB.zip"); DownloadManager.Request request = new DownloadManager.Request(Download_Uri); //Restrict the types of networks over which this download may proceed. request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI | DownloadManager.Request.NETWORK_MOBILE); //Set

Android Download Manager with progress dialog

倖福魔咒の 提交于 2020-07-06 23:20:37
问题 I have coded an android app using android download manager, and I try to show downloading progress using below code. myTimer.schedule(new TimerTask() { public void run() { try { DownloadManager.Query q; q = new DownloadManager.Query(); q.setFilterById(preferenceManager.getLong(strPref_Download_ID, 0)); cursorTimer = downloadManager.query(q); cursorTimer.moveToFirst(); int bytes_downloaded = cursorTimer.getInt(cursorTimer.getColumnIndex(DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR)); bytes

Android Download Manager with progress dialog

微笑、不失礼 提交于 2020-07-06 23:16:28
问题 I have coded an android app using android download manager, and I try to show downloading progress using below code. myTimer.schedule(new TimerTask() { public void run() { try { DownloadManager.Query q; q = new DownloadManager.Query(); q.setFilterById(preferenceManager.getLong(strPref_Download_ID, 0)); cursorTimer = downloadManager.query(q); cursorTimer.moveToFirst(); int bytes_downloaded = cursorTimer.getInt(cursorTimer.getColumnIndex(DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR)); bytes

Android Download Manager. status is always pending

夙愿已清 提交于 2020-05-15 08:10:21
问题 I try to use Download Manager to download some files form specific URL, but the download request was never completed. So I log some information to see what went wrong, it turns out the request is always in pending status, and the COLUMN_REASON is 0 which I couldn't find the corresponding description on the document. COLUMN_STATUS: 1 COLUMN_REASON: 0 COLUMN_TOTAL_SIZE_BYTES: -1 COLUMN_BYTES_DOWNLOADED_SO_FAR: 0 Here is how to start a download. val req = DownloadManager.Request(uri).apply {

how to save a downloaded file into internal storage in android?

牧云@^-^@ 提交于 2020-02-23 07:46:29
问题 i have used the below code to download a video from server in android studio and it works correctly , but when i search the video in my device i cant find it anywhere ... where does it save and how can i change destination directory on "internal storage"? private DownloadManager downloadManager; btn_download_video.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { downloadManager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE); Uri uri = Uri