Downloaded files not appearing in the Downloads App in android

Vivek picture Vivek · Oct 1, 2013 · Viewed 8.8k times · Source

I am building an application in android where users can download remote files and save them to the external storage downloads directory. It works well and I am able to view files through Es File Explorer and other file explorer tools. But those files are not appearing in Downloads App in my Nexus 4 device. Please note that I am not using DownloadManager, instead I am creating HttpUrlConnection to remote server and downloading files.

Can anybody please tell me how to make the downloaded files appear in Downloads App without using DownloadManager?

Answer

Dan Hulme picture Dan Hulme · May 15, 2014

You have to use DownloadManager to make the files show up in the app, but that doesn't mean you have to download them with DownloadManager. From API 12 onwards you can call DownloadManager.addCompletedDownload to add a file you've already downloaded to the downloads ContentProvider and therefore also to the GUI.