Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Downloading files in API <9

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?

like image 588
r2DoesInc Avatar asked Dec 04 '22 17:12

r2DoesInc


1 Answers

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.

like image 144
CommonsWare Avatar answered Dec 24 '22 20:12

CommonsWare