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
Method details
onProgress
public abstract void onProgress(BackgroundTransfer.Transfer transfer, long done, long total)Called as bytes move.
Parameters
transferBackgroundTransfer.Transfer- the transfer
donelong- bytes transferred so far
totallong- 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
transferBackgroundTransfer.Transfer- the transfer
successboolean- true when the server answered with a 2xx status
statusint- the HTTP status, or -1 for a network error or cancel