百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
F

file-downloader

> 编程语言
开源

FileDownloader, Android 上强大的 http/https 文件下载工具

386 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

FileDownloader, Android 上强大的 http/https 文件下载工具

file-downloader

FileDownloader, a powerful http/https file download tool, I am to make downloading http/https file easily on Android.

中文说明文档

Features

  • Multi task at same time, Broken-point download, Auto retry, Support download large file bigger than 2G, Powerful to deal with exceptions, download files CRUD and so on.

Captures * *


Quick start

  • step 1. add in dependencies in your module's build.gradle
java
compile 'org.wlf:FileDownloader:0.3.2'

for eclipse users, jars here: FileDownloader-0.3.2.jar, FileDownloader-0.3.2-sources.jar

  • step 2. init FileDownloader in your application's onCreate()
…
  • step 3. register listeners

-register a DownloadStatusListener(may be at the time the fragment or activity's onCreate called, you can ignore this if your app do not care the download progress, if you want to use in android service, see Use FileDownloader in Service)

…

-register a DownloadFileChangeListener if you care any change of the download file in db

…

the difference between DownloadStatusListener and DownloadFileChangeListener is, DownloadStatusListener concerns the download progress, and DownloadFileChangeListener concerns the data change

  • step 4. start to download and operate the url files(the simple use of FileDownloader APIs)

-create a new download

java
FileDownloader.start(url);// start a new download if not download yet, or continue download if it start download before, it will auto Broken-point if the server supported

-or create a custom new download

…

-pause downloads

java
FileDownloader.pause(url);// pause single
FileDownloader.pause(urls);// pause multi
FileDownloader.pauseAll();// pause all

-continue a paused download

java
FileDownloader.start(url);// continue a paused download, it will auto Broken-point if the server supported

-move download files to new dir path

java
FileDownloader.move(url, newDirPath, mOnMoveDownloadFileListener);// move single file
FileDownloader.move(urls, newDirPath, mOnMoveDownloadFilesListener);// move multi files

-delete download files

java
FileDownloader.delete(url, true, mOnDeleteDownloadFileListener);// delete single file
FileDownloader.delete(urls, true, mOnDeleteDownloadFilesListener);// delete multi files

-rename a download file

java
FileDownloader.rename(url, newName, true, mOnRenameDownloadFileListener);
  • step 5. unregister listeners

-unregister the DownloadStatusListener(may be at the time the fragment or activity's onDestroy called)

java
FileDownloader.unregisterDownloadStatusListener(mOnFileDownloadStatusListener);

-unregister the DownloadFileChangeListener

java
FileDownloader.unregisterDownloadFileChangeListener(mOnDownloadFileChangeListener);

API docs


Version change log


Upgrade to latest version help

  • 0.2.X --> 0.3.X

-replace FileDownloader.detect(String, OnDetectUrlFileListener) with FileDownloader.detect(String, OnDetectBigUrlFileListener) for supporting large file bigger than 2G to detect recommended.

-replace DownloadFileInfo.getFileSize() with DownloadFileInfo.getFileSizeLong(), and also replace DownloadFileInfo.getDownloadedSize() with DownloadFileInfo.getDownloadedSizeLong() for supporting large file bigger than 2G to detect recommended.

-replace FileDownloader.registerDownloadStatusListener(OnFileDownloadStatusListener) with FileDownloader.registerDownloadStatusListener(OnSimpleFileDownloadStatusListener or OnRetryableFileDownloadStatusListener) for better experience.

-do not forget to do unregisterDownloadStatusListener(OnFileDownloadStatusListener) and unregisterDownloadFileChangeListener(OnDownloadFileChangeListener) if your registered then, because the listeners may cause memory overflow if you never unregister then.

-replace all FailReason classes started with On by those ones started with non-On, eg. OnFileDownloadStatusFailReason -->FileDownloadStatusFailReason.

  • 0.1.X --> 0.3.X

-replace class FileDownloadManager with new class FileDownloader, also replace all methods in the FileDownloadManager with new ones recommended.

-do steps in 0.2.X --> 0.3.X


Design of FileDownloader


Code Style, follow Google Android Code Style for Contributors, contributors are required to follow the rules


Supported system version: API 8 and above(Android 2.2+)


FAQ


LICENSE

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Java

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言