Package io.objectbox.sync
@ParametersAreNonnullByDefault
package io.objectbox.sync
ObjectBox Sync allows to automatically synchronize local data with a sync
destination (e.g. a sync server) and vice versa. This is the sync client package.
These are the typical steps to setup a sync client:
- Create a BoxStore as usual (using MyObjectBox).
- Get a
SyncBuilderusingSync.client(boxStore, url, credentials). Here you need to pass theBoxStore, along with an URL to the sync destination (server), and credentials. For demo set ups, you could start withSyncCredentials.none()credentials. - Optional: use the
SyncBuilderinstance from the last step to configure the sync client and set initial listeners. - Call
SyncBuilder.build()to get an instance ofSyncClient(and hold on to it). Synchronization is now active. - Optional: Interact with
SyncClient.
-
ClassDescriptionUsed by
SyncClientto observe connectivity changes.Credentials consist of a type and the credentials data to perform authentication checks.Credentials types for login at a sync server.ObjectBox Sync makes data available on other devices.A builder to create aSyncClient; the builder itself should be created viaSync.client(BoxStore, String, SyncCredentials).A collection of changes made to one entity type during a sync transaction.ObjectBox sync client.Internal sync client implementation.Use the static helper methods to build Sync credentials, for exampleSyncCredentials.sharedSecret("secret").Internal credentials implementation.Internal credentials implementation for user and password authentication.Flags to adjust sync behavior like additional logging.Combines the functionality of a Sync client and a Sync server.Builder for a Sync client and server hybrid setup, aSyncHybrid.Codes used bySyncLoginListener.onLoginFailed(long).Returned bySyncClientImpl.getSyncState().