DJI Mobile SDK Documentation

      class DownloadListener

      interface DownloadListener<E>

      This callback will notify the app when the media download executed.

      Class Members:

      Callback Method

      method onStart
      void onStart()

      Called when the file download begins.

      method onRateUpdate
      void onRateUpdate(long total, long current, long persize)

      Called to show the download rate. It is called every 1 second. Hence, the persize which is the download size among two calls is the download rate.

      Input Parameters:
      long totalThe total size.
      long currentThe current download size.
      long persizeThe download size between two calls.
      method onRealtimeDataUpdate
      void onRealtimeDataUpdate(byte[] data, long position, boolean isLastPack)

      Called to get the media file data download from camera by byte in real time.

      Input Parameters:
      byte[] dataThe media file data download from camera by byte.
      long positionThe byte offset into the meida file at which the data starts.
      boolean isLastPacktrue if the pack is the last one.
      method onProgress
      void onProgress(long total, long current)

      Called to update the download progress. It is called every time there is data received.

      Input Parameters:
      long totalThe total size of the file being downloaded.
      long currentThe current download data size.
      method onSuccess
      void onSuccess(E data)

      Called when the media download is completed.

      Input Parameters:
      E dataThe media that was successfully downloaded
      method onFailure
      void onFailure(DJIError error)

      Called when the media download failed.

      Input Parameters:
      DJIError errorThe error information.