DownloadManager downloading files over 2.1 GB

前端 未结 5 2385
青春惊慌失措
青春惊慌失措 2021-02-19 02:53

I am working on an app and one of the features I am working on is to download some binary files. Some of them are really big (more than several mega-bytes). Downloads are comple

5条回答
  •  隐瞒了意图╮
    2021-02-19 03:40

    There is one clear outcome of this:

    You can not fix the DownloadManager. If it's a bug in it, it will be so. Therefore, in short, No, you can not workaround this issue using the DownloadManager. You could however workaround it using a server side approach that has been put into words in the other answers.

    So, I think your simplest solution would be to force the minimum sdk level to JB-MR2 because @ksasq mentioned that this issue has been resolved.

    If that is not plausible nor in your case possible, you can find the best file download library out there and create an interface similar to DownloadManager's for this library. Of course, this interface should be implemented to use the default DownloadManager for versions which do not have this bug and use the custom library for those which had this bug (and for files who cause the issue if possible).

    Unfortunately, a search on google showed yingyixu's android-download-manager last updated in 2012.

    Another unfortunate note about this topic by CommonsWare simply verifies that there is no DownloadManager in google's support libraries. Worse is that the guy gave up the idea of implementing his own port becuase it was way too complicated. You can only hope that yingyixu's library or some other library you hopefully find is good enough.

提交回复
热议问题