(x-post from SymmetricDS forum)
Do you have a working example of using SymmetricDS 3.8 to sync an Android application with a demo root node? I've worked through both of JumpMind's examples, and both fail with ECONNREFUSED against localhost:31415.
It looks like even though they know how to register with the root node on a different machine, they try to sync with it on localhost instead.
Here's a walkthrough of how to build and (unsuccessfully) run both of the existing samples.
Sample 1:
Jumpmind's original demo from 2012 used the Notepad Application, and many of the steps assume you're running in Eclipse and have their Pro version. There are a few hoops to make it compile in a modern Android Studio with the freeware version of SymmetricDS.
Android/Sdk/samples/android-23/legacy/NotePad
edit your apps gradle rule, add a compile dependency, thus:
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
static class DatabaseHelper
)Don't forget to open registration for your external ID. Something like
symadmin --properties corp-000.properties open-registration store android-003
observe the logcat failure
Building transport url: http://localhost:31415/sync/corp-000/push?nodeId=android-003&securityToken=88b79dcc9617099aec015ae5ed800b&hostName=localhost&ipAddress=10.0.2.15
Could not communicate with node 'corp:000:000' at http://localhost:31415/sync/corp-000 because of unexpected error
org.jumpmind.exception.IoException: java.net.ConnectException: failed to connect to localhost/127.0.0.1 (port 31415) after 20000ms: isConnected failed: ECONNREFUSED
Sample 2:
Jumpmind's newer sample includes support for file sync, which I don't care about right now. But it's supposed to work against the demo node corp-000 right out of the box. At least for me, it doesn't.
Here's what you have to do:
INSTALL_FAILED_CONFLICTING_PROVIDER
, I had to change the provider defined in the manifest to com.jumpmind.syncds3.DbProvider
, because there's already an app on the default Android image that uses provider com.google.provider.NotePad
.Solved. For anyone coming this way with a similar problem, the problem is twofold.
Solution:
If you're running on Linux, feel free to use my scripted demo server. It sets sync-url to the first IP address in the list instead of localhost.
Otherwise: