public interface

DownloaderProgressListener

implements KinveyClientCallback<T>
com.kinvey.java.core.DownloaderProgressListener

Class Overview

An interface for receiving progress notifications for downloads.

Sample usage:

  public static class MyDownloadProgressListener implements DownloaderProgressListener {

    public void progressChanged(MediaHttpDownloader downloader) throws IOException {
      switch (downloader.getDownloadState()) {
        case DOWNLOAD_IN_PROGRESS:
          System.out.println("Download in progress");
          System.out.println("Download percentage: " + downloader.getProgress());
          break;
        case DOWNLOAD_COMPLETE:
          System.out.println("Download Completed!");
          break;
      }
    }

  }
 

Summary

Public Methods
abstract void progressChanged(MediaHttpDownloader downloader)
Called to notify that progress has been changed.
[Expand]
Inherited Methods
From interface com.kinvey.java.core.KinveyClientCallback

Public Methods

public abstract void progressChanged (MediaHttpDownloader downloader)

Called to notify that progress has been changed.

This method is called multiple times depending on how many chunks are downloaded. Once the download completes it is called one final time.

The download state can be queried by calling getDownloadState() and the progress by calling getProgress().

Parameters
downloader Media HTTP downloader
Throws
IOException