0

I was using Firefox and for some reason it deleted all downloads from the SD card.

I found an in-built app "Downloads" which has a list of all files downloaded to date, listing both Chrome and Firefox downloads.

Click Image to enlarge

Downloads

How can I export a list of filenames (and their respective URLs, if possible) shown in this "Downloads" app?

  • Did not the answer work for you? You haven't responded at all. – Firelord Nov 19 '15 at 2:10
  • Hey @Firelord sorry I couldn't implement your great answer - I m currently in a city with almost no network (no internet), will reply asap. Thanks for the great answer though :) – RinkyPinku Nov 22 '15 at 6:50
0

The Downloads app has the name DownloadsProviderUI (com.android.providers.downloads.ui). The entries shown by it are not handled by or stored inside its data directory. Instead, the app is just a front-end for DownloadsProvider (com.android.providers.downloads).

The information you're seeking is stored inside

/data/data/com.android.providers.downloads/databases/downloads.db

Provided that your OEM has not messed up with the manifest of DownloadProvider, you should be able to backup the app using .

Instructions

  1. Setup adb in PC and connect the device, with USB debugging enabled, into PC.
  2. Launch a shell and execute the command

    adb backup com.android.providers.downloads

    Agree for the backup on the device. You should now be having a backup file named backup.ab.

  3. Follow any of the solution here to extract the content from the file. (I prefer Android Backup Extractor.)

    You should now be having a file named downloads.db, possibly under apps/com.android.providers.downloads/db/ (inside the extracted content).

  4. You now have many options to open the database file. You can use GUI solutions like Sqliteman or DB Browser for SQLite. The former one can export the data into an HTML file.

    Anyhow, inside the file, the table downloads has the relevant columns, namely: uri, title and _data.

    If you've sqlite3 installed, you can do:

    sqlite3 downloads.db
    .mode line
    .headers on
    .out info.txt
    select uri,title,_data from downloads
    .quit
    

    You should now be having a file info.txt. Open it and you would see a structure, such as:

    uri = http://dl-xda.xposed.info/modules/biz.bokhorst.xprivacy_v471_8ba0b6.apk
    title = XPrivacy
    _data = /data/data/com.android.providers.downloads/cache/biz.bokhorst.xprivacy_v471_8ba0b6.apk
    
    uri = non-dwnldmngr-download-dont-retry2download
    title = ProcessMonitor.zip
    _data = /storage/sdcard0/Download/ProcessMonitor.zip
    

    There exists other modes for formatting. For e.g., change .mode to csv and .out to file.csv and then keep the rest of the commands intact. Execute all the commands serially and you would end up with a CSV file.

    (You can use PRAGMA table_info('downloads') or .schema downloads to know the name of all the columns inside the table downloads.)

    If required, see this article on ZetCode to know what the aforesaid SQL commands does.

  • Some Android apps here may also be able to view and export the data from the database file. – Firelord Nov 14 '15 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.