Skip to content

Get the internal stored data

Jacksgong edited this page Apr 14, 2016 · 1 revision

All task data will be stored in FileDownlaoder Database, and FileDownloader will maintain it automatically.

Main Download Data

You can get bellow data anywhere with a DownloadId.

// Get the status.
FileDownloader.getImpl().getStatus(downloadId);

// Get the downloaded so far bytes.
FileDownloader.getImpl().getSofar(downloadId);

// Get the total bytes.
FileDownloader.getImpl().getTotal(downloadId);

Other Data

And you can get some other data from the call-back method in FileDownloadListener:

Ref: BaseDownloadTask

For example:

task.getTag();
task.getTag(key);
task.getEtag();
task.isReusedOldFile();
task.isResuming();
task.getUrl();
task.getEx();

P.S: If you need some more data, recommend maintain your own Database for your business, Ref: TasksManagerDemoActivity