Clienteling isn’t a new theory. It can be traced back hundreds of years when shopkeepers …
Mobile replication with Android edge devices in near real time to an on-premise or cloud based database or warehouse. Through a simple integration into your Android application you can unleash the full replication power of the SymmetricDS platform with your mobile devices running Android.
dependencies { implementation("org.jumpmind.symmetric:symmetric-pro-android:3.15.0") { exclude(group = "org.slf4j", module="slf4j-api") exclude(group = "org.slf4j", module="jcl-over-slf4j") exclude(group = "org.apache.logging.log4j", module="log4j-slf4j-impl") exclude(group = "org.apache.logging.log4j", module="log4j") exclude(group = "org.apache.logging.log4j", module="log4j-core") } }
dependencies { implementation"org.jumpmind.symmetricds:symmetric-pro-android:3.15.0" }
Add the following code to your default activity.
Create database constants and an implementation of the SQLiteOpenHelper to allow SymmetricDS to connect to your device database
DatabaseName – Replace with your SQLite database name.
val DATABASE_NAME = "DatabaseName"
val DATABASE_VERSION = 1
class SDSDbHelper(context: Context) : SQLiteOpenHelper(context, DATABASE_NAME, null, DATABASE_VERSION) {
override fun onCreate(p0: SQLiteDatabase?) {
}
override fun onUpgrade(p0: SQLiteDatabase?, p1: Int, p2: Int) {
}
}
val symmetricdsOpenHelper = SDSDbHelper(this); val HELPER_KEY = "SymmetricDSHelperKey"; SQLiteOpenHelperRegistry.register(HELPER_KEY, symmetricdsOpenHelper) val intent = Intent(this, SymmetricService::class.java) intent.putExtra(SymmetricService.INTENTKEY_SQLITEOPENHELPER_REGISTRY_KEY, HELPER_KEY) intent.putExtra( SymmetricService.INTENTKEY_REGISTRATION_URL,"http://10.0.2.2:31415/sync/server" ) val properties = Properties() properties.setProperty(ParameterConstants.AUTO_RELOAD, "true") intent.putExtra(SymmetricService.INTENTKEY_PROPERTIES, properties) intent.putExtra(SymmetricService.INTENTKEY_EXTERNAL_ID, "android-simulator") intent.putExtra(SymmetricService.INTENTKEY_NODE_GROUP_ID, "client") intent.putExtra(SymmetricService.INTENTKEY_START_IN_BACKGROUND, true) this.startService(intent)
Now its time to allow this node into the sync scenario from the central SymmetricDS node.
The manage node screen will display all devices attempting to connect to the central
Allowing the device to register initiates the security handshake for all future communication and begins replication.
You are not set for mobile replication with Android using SymmetricDS. Read more about subsetting data to reduce how much your sending to each device.