Docs Menu
Docs Home
/ /
Atlas Device SDKs
/ /

Check Upload & Download Progress for a Sync Session - Java SDK

Note

Flexible Sync progress notifications are not yet fully supported. When using Flexible Sync, downloads only report notifications after changes are integrated. Partition-Based Sync provides ongoing notifications as changes progress downloading. Uploads report ongoing progress notifications for both Sync Modes.

To subscribe to progress updates for uploads, call addUploadProgressListener() on your SyncSession with a ProgressMode and a ProgressListener(). The ProgressMode passed determines which upload events your listener receives:

app.getSync().getSession(config).addUploadProgressListener(ProgressMode.INDEFINITELY, new ProgressListener() {
@Override
public void onChange(Progress progress) {
Log.v("EXAMPLE", "Upload progress: " + progress.getFractionTransferred());
}
});
app.sync.getSession(config).addUploadProgressListener(
ProgressMode.INDEFINITELY) { progress ->
Log.v("EXAMPLE", "Upload progress: ${progress.fractionTransferred}")
}

To subscribe to progress updates for downloads, call addDownloadProgressListener() on your SyncSession with a ProgressMode and a ProgressListener(). The ProgressMode passed determines which download events your listener receives:

app.getSync().getSession(config).addDownloadProgressListener(ProgressMode.INDEFINITELY, new ProgressListener() {
@Override
public void onChange(Progress progress) {
Log.v("EXAMPLE", "Download progress: " + progress.getFractionTransferred());
}
});
app.sync.getSession(config).addDownloadProgressListener(
ProgressMode.INDEFINITELY) { progress ->
Log.v("EXAMPLE", "Download progress: ${progress.fractionTransferred}")
}

Back

Pause or Resume a Sync Session