public interface

UploaderProgressListener

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

Class Overview

An interface for receiving progress notifications for uploads.

Sample usage:

  public static class MyUploadProgressListener implements UploaderProgressListener {

    public void progressChanged(MediaHttpUploader uploader) throws IOException {
      switch (uploader.getUploadState()) {
        case INITIATION_STARTED:
          System.out.println("Initiation Started");
          break;
        case INITIATION_COMPLETE:
          System.out.println("Initiation Completed");
          break;
        case DOWNLOAD_IN_PROGRESS:
          System.out.println("Upload in progress");
          System.out.println("Upload percentage: " + uploader.getProgress());
          break;
        case DOWNLOAD_COMPLETE:
          System.out.println("Upload Completed!");
          break;
      }
    }
  }
 

Summary

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

Public Methods

public abstract void progressChanged (MediaHttpUploader uploader)

Called to notify that progress has been changed.

This method is called once before and after the initiation request. For media uploads it is called multiple times depending on how many chunks are uploaded. Once the upload completes it is called one final time.

The upload state can be queried by calling getUploadState() and the progress by calling getProgress().

Parameters
uploader Media HTTP uploader
Throws
IOException