I just realized that my app, with over 300 users still using an Android version under Gingerbread, is having issues for them because they dont have the DownloadManager that was introduced in API 9 (2.3). Is there a compatibility library or something that I can use or is my best best just to use an asyncTask to download the files manually?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Is there a compatibility library or something that I can use
No, DownloadManager
is not in the Android Support package. I took a look at making my own backport a while ago and concluded that it was way too complicated, since it has its own content provider and whatnot.
is my best best just to use an asyncTask to download the files manually?
If the files are large, I would consider an IntentService
over an AsyncTask
, so the download can be better decoupled from the UI. But, regardless, you do need to download it yourself.