DJI Mobile SDK Documentation

      class DownloadListener

      interface DownloadListener<E>
      Package:dji.sdk.media
      Description:

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

      Class Members:

      Callback Method

      State
      method
      method onStart
      void onStart()
      Package:dji.sdk.media
      Description:

      Called when the file download begins.

      method onRateUpdate
      void onRateUpdate(long total, long current, long persize)
      Package:dji.sdk.media
      Description:

      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)
      Package:dji.sdk.media
      Description:

      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)
      Package:dji.sdk.media
      Description:

      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
      method onSuccess
      void onSuccess(E data)
      Package:dji.sdk.media
      Description:

      Called when the media download is completed.

      Input Parameters:
      E dataThe media that was successfully downloaded
      method
      method onFailure
      void onFailure(DJIError error)
      Package:dji.sdk.media
      Description:

      Called when the media download failed.

      Input Parameters:
      DJIError errorThe error information.