在下载API&LT文件; 9 [英] Downloading files in API <9

查看:129
本文介绍了在下载API&LT文件; 9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我才意识到,我的应用程序,拥有超过300个用户还在使用,是有他们的问题,因为他们没有说是在API 9(2.3)推出的下载管理器姜饼下​​Android版本。是否有一个兼容性库或东西,我可以使用或是我最好最好只使用一个AsyncTask的手动下载文件?


解决方案

  

有一个兼容性库或东西,我可以使用


没有,下载管理器不在Android的支持包。我看了看我自己能做反向移植前一阵子,并得出结论,这是的办法的太复杂了,因为它有自己的内容提供商和诸如此类的东西。


  

是我最好最好只使用一个AsyncTask的手动下载文件?


如果文件比较大,我会考虑一个 IntentService 在一个的AsyncTask ,所以下载可以更好从UI脱钩。但是,不管,你需要自己下载吧。

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?

解决方案

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.

这篇关于在下载API&LT文件; 9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆