android-download-manager
How to Enable Android Download Manager
Please edit my answer if is not valid Check if download manager is available: int state = this.getPackageManager().getApplicationEnabledSetting(“com.android.providers.downloads”); if(state==PackageManager.COMPONENT_ENABLED_STATE_DISABLED|| state==PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER ||state==PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED){ // Cannot download using download manager } else { request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, fileName); request.setDescription(fileName); manager.enqueue(request); } And the solution for trying to enable download manager is: packageName = “com.android.providers.downloads” try { //Open the specific App Info … Read more
Unknown URL content://downloads/my_downloads
For those who are getting Error Unknown URI: content://downloads/public_downloads. I managed to solve this by getting a hint given by @Commonsware in this answer. I found out the class FileUtils on GitHub. Here InputStream methods are used to fetch file from Download directory. // DownloadsProvider else if (isDownloadsDocument(uri)) { final String id = DocumentsContract.getDocumentId(uri); if … Read more
Android download manager completed
A broadcast is sent by the DownloadManager whenever a download completes, so you need to register a broadcast receiver with the appropriate intent action( ACTION_DOWNLOAD_COMPLETE ) to catch this broadcast: To register receiver registerReceiver(onComplete, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE)); and a BroadcastReciever handler BroadcastReceiver onComplete=new BroadcastReceiver() { public void onReceive(Context ctxt, Intent intent) { // your code } … Read more