dotmimsync
1.1.1-beta19indexedAndroid port of a C# library enables synchronization of databases, facilitating seamless integration with HTTP sessions using the OkHttp library.
0
Stars
—
Used by
dependents
—
Health
/ 100
Android port of a C# library enables synchronization of databases, facilitating seamless integration with HTTP sessions using the OkHttp library.
Surfaced from shared tags and platforms — no rankings paid for.
Kotlin Multiplatform port for Dotmim.Sync C# library. Original library documentation can be found here
To use library in your app add link to JitPack repo
allprojects {
repositories {
...
mavenCentral()
}
}
and add library dependency to your app build.gradle
dependencies {
implementation 'io.github.vunder.dotmimsync:dotmimsync-core:VERSION'
}
General use-cases you can find in original library documentation
Version 1.1.1 starts using BLOB type for Uuid values. This must be reflected in your code
Here is a version match table. Left column represent current library, right column - Dotmim.Sync library
| Library version | Dotmim.Sync version |
|---|---|
| 1.0-1.1.0 | 0.9.1 or lower |
| 1.1.0 | 0.9.1 or lower |
| 1.1.1 | 0.9.1 or lower |
BundledSQLiteDriver().open(databaseFullPath).use { sqliteConnection ->
val syncSetup = SyncSetup() // fill sync tables info
val serverOrchestrator = WebClientOrchestrator(
"http://your-server-api",
httpClient, // injected on created Ktor HttpClient instance
authHeader // server authentication header, e.g. "Bearer <token>"
)
val clientProvider = SqliteSyncProvider(sqliteConnection)
val syncOptions = SyncOptions(useVerboseErrors = true)
val agent = SyncAgent(clientProvider, serverOrchestrator, syncOptions, syncSetup)
val progress = object : Progress<ProgressArgs> {
override fun report(value: ProgressArgs) {
Log.d(
"sync-progress",
"LOCAL[${value.eventId}]. ${value.context.syncStage}: ${value.message} ${value.progressPercentage * 100}% (${value.hint})(${value.context.sessionId})"
)
}
}
val syncResult = agent.synchronize(progress = progress)
}