Ditto

class Ditto @JvmOverloads constructor(val dependencies: DittoDependencies, val identity: DittoIdentity = DittoIdentity.OfflinePlayground(dependencies)) : DittoBase

Ditto is the entry point for accessing Ditto-related functionality in the Android SDK.

Parameters

dependencies

the dependencies required by the SDK to be initialised.

identity

the identity to be used to represent the connected client.

Constructors

Link copied to clipboard
constructor(dependencies: DittoDependencies, identity: DittoIdentity = DittoIdentity.OfflinePlayground(dependencies))

Creates a Ditto instance.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

A flag indicating whether or not the SDK has been activated with a valid license token.

Link copied to clipboard

The App ID component of the identity in use.

Link copied to clipboard

Provides access to authentication information and methods for logging on to Ditto Cloud.

Link copied to clipboard

An optional callback that will be called with lifecycle events relating to the SDK.

Link copied to clipboard
Link copied to clipboard

Configure a custom identifier for the current device.

Link copied to clipboard

Provides access to the SDK's disk usage monitoring.

Link copied to clipboard
protected val dittoWrapper: DittoHandleWrapper

Alias to dittoHandleWrapper with protected visibility for android.Ditto.

Link copied to clipboard
protected val identity: DittoIdentity
Link copied to clipboard

A flag indicating whether or not sync is active. Use startSync() to activate and stopSync() to deactivate sync.

Link copied to clipboard

Path to the persistence directory in use.

Link copied to clipboard

3rd version of presence. Use getPresence() to call from Java.

Link copied to clipboard

Returns a string identifying version metadata of the Ditto SDK. Example: And4.4.3_73d36

Link copied to clipboard

The site identifier component of the identity in use.

Link copied to clipboard

Provides access to the SDK's small peer info functionality.

Link copied to clipboard

Provides access to store related functionality.

Link copied to clipboard

Provides access to sync related functionality.

Link copied to clipboard

Assign a new transports configuration. By default peer-to-peer transports (Bluetooth and WiFi) are enabled.

Functions

Link copied to clipboard
open override fun close()

Shut down Ditto and release all resources. Must be called before recreating a Ditto instance that uses the same persistence directory.

Link copied to clipboard

Explicitly opt-in to disabling the ability to sync with Ditto peers running any version of the SDK in the v3 (or lower) series of releases.

Link copied to clipboard
protected fun finalize()

Close before garbage collection.

Link copied to clipboard

Request bulk status information about the transports. This is mostly intended for statistical or debugging purposes.

Link copied to clipboard
protected open override fun initSdkVersion()

Initializes the Ditto Android SDK.

Link copied to clipboard

Request information about Ditto peers connected to this device.

Link copied to clipboard

Request information about Ditto peers in the local peer-to-peer network. The V2 observer differs from observePeers by providing not just information about the immediate peers, but also multihop information from other peers not immediately connected. V2 presence therefore offers a more complete view of the local peer-to-peer network.

Link copied to clipboard

Provide a hint to Ditto that app permissions may have changed.

Link copied to clipboard

Removes all sync metadata for any remote peers which aren't currently connected. This method shouldn't usually be called. Manually running garbage collection often will result in slower sync times. Ditto automatically runs a garbage a collection process in the background at optimal times.

Link copied to clipboard

Activate an offline Ditto instance by setting a license token. You cannot sync with Ditto before you have activated it. The offline license token is only valid for manual, offlinePlayground, and sharedKey identities.

Link copied to clipboard
open fun startSync()

Starts the network transports. Ditto will connect to other devices and sync with them where appropriate.

Link copied to clipboard
open fun stopSync()

Stops all network transports.

Link copied to clipboard
protected open override fun updateTransportSyncWithParameters()