在队列中的Android下载文件 [英] Download files in queue in Android
问题描述
我如何下载多个文件队列中的一个接一个!我使用这为样本code,因为。 我将传递的URL字符串中从我的本地数据库动态下载。
How do I download multiple files in a queue one by one! I'm using this as a sample code, since. I would be passing the URLs to download in Strings from my local DB dynamically.
请让我知道该怎么做。我想下载到尽快启动应用程序启动。请帮助我! Android开发类型:新手上路 下载队列中的目的:要在应用内计费获得成功后,从服务器下载多个文件
Please let me know how to do that. I want the download to start as soon as the application launches. Kindly help me out! Android Dev Type: Newbie Purpose of Download Queue: To download multiple files from the server after in-app billing gets successful!
PS:我已经提到这题。但我不知道这会解决我的问题!
P.S.: I already referenced this question. But I'm not sure if that would solve my issue!
推荐答案
排队的请求的一个好方法可以异步处理,一次一个,是一个 IntentService
。如果你有一个 IntentService
从所提供的意图
,那么所有你所要做的就是创建一个<$读取网址C $ C>意图对于要下载,并发送每个文件的意图
到服务,
A good way of queuing up requests to be handled asynchronously, one at a time, is with an IntentService
. If you have an IntentService
which reads URLs from the supplied Intent
, then all you have to do is create an Intent
for each file you want to download, and send each Intent
to the service,
修改:我看你已经提到了类似的问题,如果答案建议 IntentService
。所以,也许你应该使用 IntentService
。 :)
EDIT: I see you've already referred to a similar question, where the answer recommends IntentService
. So, maybe you should use an IntentService
. :)
这篇关于在队列中的Android下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!