Application with automatic synchronizaton

Hello everyone!
I am hoping to use ODK-X for developing a game application. ODK-X Services has a Sync page where clicking on ‘SYNC NOW’ will start synchronization with server. I am trying to automate this process in my application. Could someone tell me which method from this code (Releases · odk-x/services · GitHub) is called on pressing that button and if there is some API to directly access it? What is the best way to incorporate such automatic synchronization in an application?

The examples from ODK-X documentation launch the ODK-X Services Sync activity which requires clicking on SYNC NOW button, but I wish to replace those manual steps with a parallel thread that runs bi-directional syncing every few seconds.

Thank you!

The activity actually displays the SyncFragment that has the code for starting sync and updating the UI.

Access Sync is currently only available from the Java code. I am not aware of a call on the JavaScript side (though I could be wrong).

An issue to consider, if a conflict is reached what is the correct behavior if everything is being done in the background? Normally we do everything in the background but have a UI available to track progress.

Here is a link to the fragment

2 Likes