android-download-manager

Where can I find DownloadManager's ContentProvider implementation

百般思念 提交于 2019-12-06 01:59:28
问题 I've searched through android's open source code as much as I could and I haven't been able to find the implementation to the actual downloading via the DownloadManager in the 2.3 SDK. I have found the source for the DownloadManager and the source for a download class that has constants to interact with the ContentProvider but I haven't been able to find the source for the ContentProvider . I'm wanting to find this so that I can know a good way to implement a download of my own, since I'll be

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

吃可爱长大的小学妹 提交于 2019-12-05 07:35:56
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 (Oreo). According to https://developer.android.com/about/versions/oreo/background#broadcasts , implicit

can we open download folder via. intent?

百般思念 提交于 2019-12-05 01:27:46
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. You can show the recent downloads activity with the following Intent startActivity(new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS)); Available since API 9 Samsung solution: public static void openDownloads(@NonNull Activity activity) { if (isSamsung()) { Intent intent = activity

Why does the “download completed” notification disappear on Gingerbread devices?

自作多情 提交于 2019-12-04 23:05:45
I'm using the DownloadManager class to programatically download a file. All works fine but I can't get the download completed notifcation to persist. It disappears immediately once the download has completed. Here's my code: Request rqtRequest = new Request(Uri.parse(((URI) vewView.getTag()).toString())); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) { rqtRequest.setShowRunningNotification(true); } else { rqtRequest.setNotificationVisibility(Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); } ((DownloadManager) getSystemService(DOWNLOAD_SERVICE)).enqueue(rqtRequest); I've

How to get file name when clicking on URL in webview

﹥>﹥吖頭↗ 提交于 2019-12-04 22:47:19
问题 How to get the file name which we uploaded on server when we provide linked for that file in page? What I am doing is, I am providing data with file link in webview so whenever user click on link need to download from server as I have download this file from server but the problem is not able to get its exact type and name using DownloadManager. I want like this See in above I have given link for my file in test_androt and when I click it will give the dailog with option having the file name,

Download a file with download manager Issue in android

╄→尐↘猪︶ㄣ 提交于 2019-12-04 14:40:00
问题 I am downloading a file from specific URL. The function is working fine with other URL for downloading the file but when I try to download a song from this URL then code runs successfully but downloaded song is just 7 kb in size. Actual size of song is more than 12MB. Am I missing something? Here is my code to download a song. private void DownloadTask(String downloadUrl){ Log.e("downloadUrl==>",downloadUrl+""); DownloadManager.Request request = new DownloadManager.Request(Uri.parse

Android Download Multiple Files one after another and show progress in ListView

时光怂恿深爱的人放手 提交于 2019-12-04 12:40:26
The user can add any number of downloads, but download will start one after another i.e. next download will start only after the completion of present download. The user will navigate away from the activity showing download progress in order to add new downloads, and when new file to be downloaded is added, the application navigates back to the activity showing download progress, where it will show the progress of the download, previously added, and keep the presently added file as pending download. As soon as the downloading completes, pending download will start downloading. In this way the

DownloadManager not storing Downloaded files in Download Folder

别来无恙 提交于 2019-12-04 08:19:24
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_DOWNLOAD_ID, 0); Query query = new Query(); query.setFilterById(enqueue); Cursor c = dm.query(query); if (c

Where can I find DownloadManager's ContentProvider implementation

一笑奈何 提交于 2019-12-04 06:29:29
I've searched through android's open source code as much as I could and I haven't been able to find the implementation to the actual downloading via the DownloadManager in the 2.3 SDK. I have found the source for the DownloadManager and the source for a download class that has constants to interact with the ContentProvider but I haven't been able to find the source for the ContentProvider . I'm wanting to find this so that I can know a good way to implement a download of my own, since I'll be using a lesser version than 2.3 for my app. Pzanno I was able to find this here . You can also get the

Download Files Using download manager

て烟熏妆下的殇ゞ 提交于 2019-12-03 21:09:32
问题 I am downloading files from server using DownloadManager class Here is what i am doing public void downloadPdf(String url, String sem, String title, String branch) { Uri Download_Uri = Uri.parse(url); 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 whether this download may