Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to know in which state downloader now ? #8

Closed
kirill-kostenetskyi opened this issue Aug 9, 2015 · 2 comments
Closed

How to know in which state downloader now ? #8

kirill-kostenetskyi opened this issue Aug 9, 2015 · 2 comments

Comments

@kirill-kostenetskyi
Copy link

Please, help me to understandm how can i know in which state my task : pause, downlaoded or something else. After i write ReportStructure report = dm.singleDownloadStatus(taskToken); how can i get information from that ? Thank you

@majidgolshadi
Copy link
Owner

Hi
In singleDownloadStatus method you got a ReportStructure object that contain state property. As I mention in readme you can find your task state

  • TaskState.INIT: task intruduce for library and gave you token back but it didn't started yet.
  • TaskState.READY: download task data fetch from its URL and it's ready to start.
  • TaskState.DOWNLOADING: download task in downloading process.
  • TaskState.PAUSED: download task in puase state. If in middle of downloading process internet disconnected; task goes to puase state and you can start it later
  • TaskState.DOWNLOAD_FINISHED: download task downloaded completely but their chunks did not rebuild.
  • TaskState.END: after rebuild download task chunks, task goes to this state and notified developer with OnDownloadCompleted(long taskToken) interface

@kirill-kostenetskyi
Copy link
Author

i found how to get states. i added getState method to ReportStructure class , and when i need to current state of downlaod, i just call it.
thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants