Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public interface BackgroundTransfer.Listener

Receives transfer progress and completion on the EDT.

Methods

public abstract void onProgress(BackgroundTransfer.Transfer transfer, long done, long total)Called as bytes move.
public abstract void onComplete(BackgroundTransfer.Transfer transfer, boolean success, int status)Called once when the transfer ends.

Method details

onProgress

public abstract void onProgress(BackgroundTransfer.Transfer transfer, long done, long total)
Called as bytes move.

Parameters

transfer BackgroundTransfer.Transfer
the transfer
done long
bytes transferred so far
total long
total bytes, or -1 when unknown

onComplete

public abstract void onComplete(BackgroundTransfer.Transfer transfer, boolean success, int status)
Called once when the transfer ends.

Parameters

transfer BackgroundTransfer.Transfer
the transfer
success boolean
true when the server answered with a 2xx status
status int
the HTTP status, or -1 for a network error or cancel