FileDownloader, powerful http/https file download tool on Android
FileDownloader, powerful http/https file download tool on Android
FileDownloader, a powerful http/https file download tool, I am to make downloading http/https file easily on Android.
Features
Captures * *
Quick start
compile 'org.wlf:FileDownloader:0.3.2'for eclipse users, jars here: FileDownloader-0.3.2.jar, FileDownloader-0.3.2-sources.jar
…-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
-create a new download
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
FileDownloader.pause(url);// pause single
FileDownloader.pause(urls);// pause multi
FileDownloader.pauseAll();// pause all-continue a paused download
FileDownloader.start(url);// continue a paused download, it will auto Broken-point if the server supported-move download files to new dir path
FileDownloader.move(url, newDirPath, mOnMoveDownloadFileListener);// move single file
FileDownloader.move(urls, newDirPath, mOnMoveDownloadFilesListener);// move multi files-delete download files
FileDownloader.delete(url, true, mOnDeleteDownloadFileListener);// delete single file
FileDownloader.delete(urls, true, mOnDeleteDownloadFilesListener);// delete multi files-rename a download file
FileDownloader.rename(url, newName, true, mOnRenameDownloadFileListener);-unregister the DownloadStatusListener(may be at the time the fragment or activity's onDestroy called)
FileDownloader.unregisterDownloadStatusListener(mOnFileDownloadStatusListener);-unregister the DownloadFileChangeListener
FileDownloader.unregisterDownloadFileChangeListener(mOnDownloadFileChangeListener);Upgrade to latest version help
-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.
-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
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+)
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.No open issues yet, or sync has not completed.