On 02/26/2014 09:52 AM, Joshua Dover wrote:
I’ve been working on offloading our downloads to use Android’s built-in download manager to gain quite a few benefits (which for brevity’s sake I won’t cover here, but you can follow the progress in bug 816318 <https://bugzilla.mozilla.org/show_bug.cgi?id=816318>), but most importantly a more consistent Android experience that users are used to.

Unfortunately, the DownloadManager system service was not available until Gingerbread so we have a few alternatives for Froyo devices that I’d like some input on:

1) Use our existing implementation that uses nsIDownloadManager

We have an existing download mechanism that works that we can fall back to for Froyo devices. We can continue shipping this as a fall back until Froyo usage (currently ~2%) has decreased enough that we drop support all-together.

There’s also been work on bug 901360 <https://bugzilla.mozilla.org/show_bug.cgi?id=901360> to transition to the newer Downloads.jsm backend that desktop uses that we could land. Benefits include putting downloads on a background thread.

2) We lift Froyo’s Download content provider from source

Froyo does have a Downloads content provider <http://androidxref.com/2.2.3/xref/packages/providers/DownloadProvider/src/com/android/providers/downloads/DownloadProvider.java> that we could possibly use similar to how it is used here <http://androidxref.com/2.2.3/xref/packages/apps/Browser/src/com/android/browser/BrowserActivity.java#2900>. This would make the download for us, and then we would need to build a simple activity that simply lists the downloads and allows for opening and deleting. Unfortunately, the content provider is only available to system-level application due to a system permission <http://androidxref.com/2.2.3/xref/packages/providers/DownloadProvider/AndroidManifest.xml#10> required, so we would need to pull the entire source and get that working ourselves.
I had done similar work before. The source code is available here:
https://github.com/yxl/DownloadProvider

I got many feedback from android developers that they need embed a download content provider into their apps.
_______________________________________________
mobile-firefox-dev mailing list
mobile-firefox-dev@mozilla.org
https://mail.mozilla.org/listinfo/mobile-firefox-dev

Reply via email to