文件的Andr​​oid更快的下载与多线程 [英] Android faster download of files with Multi thread

查看:132
本文介绍了文件的Andr​​oid更快的下载与多线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作,需要大的视频文件(300-500MB)下载的应用程序。结果
我想知道如果有一种方法可以加快使用多线程的单个文件的下载。结果
我已经看到了这种类型的实施像TUBEMATE应用程序,但我茫然不知用来实现它的code。结果
我不需要你code对我来说:)我只需要一个起点,就像这个文章或教程,TKS。

I'm working on an app that requires downloading of big video files (300-500MB).
I would like to know if there's a way to speed up the download of a single file using multi-threading.
I've saw this type of implementation on applications like TubeMate, but I clueless about the code used to achieve it.
I don't need you to code for me :) I just need a starting point, like an article or tutorial about this, tks.

推荐答案

无论找到一个库函数,你也可以让自己的脚本来处理部分下载。

Regardless of finding a library function, you could also make your own script to handle partial downloads.

例如,在PHP中,你可以使用fopen()函数,FREAD()...功能在服务器上打开一个流,寻求文件到一个特定的位置和发送的字节给请求者。文件偏移和块长度参数也由客户端使用POST或GET方法来设置。

For example, in PHP, you can use the fopen(), fread()... functions to open a stream on the server, seek the file to a particular position and transmit bytes to the requester. File offset and chunk length parameters would be set by the client using POST or GET methods.

检查<一href=\"http://stackoverflow.com/questions/1395656/is-there-a-good-implementation-of-partial-file-downloading-in-php\">this链接。也许它可以帮助你一点点。

Check this link. Maybe it helps you a little bit.

如果,在另一方面,你没有访问到服务器,而你只是想从任何互联网网站下载改善,那么你可以看看为的 HTTP范围标头或的这里

If, on the other hand, you don't have access to the server, and you just want to improve downloads from any Internet site, then you could look up for HTTP range header or here.

这篇关于文件的Andr​​oid更快的下载与多线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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