novoda/download-manager
소개
장시간 다운로드를 관리하는 라이브러리입니다. 네트워크 통신을 처리하고 다운로드 실패 시 자동으로 재시도합니다.
시스템 및 인프라측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originaldownload-manager


A library that handles long-running downloads, handling the network interactions and retrying downloads automatically after failures. Clients can request downloads in batches, receiving a single notification for all of the files allocated to a batch while being able to retrieve the single files after downloads complete.
Adding to your project
To start using this library, add these lines to the build.gradle of your project:
repositories {
jcenter()
}
dependencies {
compile 'com.novoda:download-manager:<latest-version>'
}
Simple usage
- Create a
DownloadManager:
DownloadManager downloadManager = DownloadManagerBuilder
.newInstance(this, handler, R.mipmap.ic_launcher_round)
.withLogHandle(new DemoLogHandle())
.withStorageRequirementRules(StorageRequirementRuleFactory.createByteBasedRule(TWO_HUNDRED_MB_IN_BYTES))
.build();
- Create a
Batchof files to download:
Batch batch = Batch.with(primaryStorageWithDownloadsSubpackage, DownloadBatchIdCreator.createSanitizedFrom("batch_id_1"), "batch one title")
.downloadFrom("http://ipv4.download.thinkbroadband.com/5MB.zip").saveTo("foo/bar", "local-filename-5mb.zip").withIdentifier(DownloadFileIdCreator.createFrom("file_id_1")).apply()
.downloadFrom("http://ipv4.download.thinkbroadband.com/10MB.zip").apply()
.build();
- Schedule the batch for download:
downloadManager.download(batch);
Snapshots
Snapshot builds from develop are automatically deployed to a repository that is not synced with JCenter.
To consume a snapshot build add an additional maven repo as follows:
repositories {
maven {
url 'https://dl.bintray.com/novoda-oss/snapshots/'
}
}
You can find the latest snapshot version following this link.
Contributing
We always welcome people to contribute new features or bug fixes, here is how.
If you have a problem, check the Issues Page first to see if we are already working on it.
관련 프로젝트 살펴보기
불러오는 중…