Downloading files in API <9

流过昼夜 提交于 2019-12-22 08:35:50

问题


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.



来源:https://stackoverflow.com/questions/9967165/downloading-files-in-api-9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!