This is a tiny downloader on Android, it just support Http & Https & HLS download now. Will support more in the future.
There is two ways to download.
-
Normal.
-
Multi-Thread.
-
HLS
You could also choose quick way to import my exdownloader library into your project.
compile 'com.theo:exdownloader:1.1.0'
<dependency>
<groupId>com.theo</groupId>
<artifactId>exdownloader</artifactId>
<version>1.1.0</version>
<type>pom</type>
</dependency>
See the demo code.
mDownloader = DownloaderFactory.create(DownloaderFactory.Type.MULTI_SEGMENT, task);
if (mDownloader != null) {
mDownloader.setListener(mDownloadListener);
mDownloader.create();
}
mDownloader.start();
mDownloader.pause();
load the data(from onSaveInstance()) to create downloader.
resume download from the saved data.
mDownloader = DownloaderFactory.load(FileUtil.readFile(new File(mTempPath)));
if (mDownloader != null) {
mDownloader.setListener(mDownloadListener);
}
Any problem?
Welcome to contact me for help.
Tinker is under the BSD license. See the LICENSE file for details.