-
-
Notifications
You must be signed in to change notification settings - Fork 224
Description
Issue by shapirus
Monday Mar 05, 2018 at 08:37 GMT
Originally opened as brarcher/loyalty-card-locker#220
Let's assume I want to keep a cards database shared with my family (say 2 devices for now). Right now, there is one standard possibility:
- Edit cards on device 1
- Export on device 1
- Sync with your favorite file sync software
- Import on device 2
And then in the reverse order when the database is changed on device 2.
This requires manual actions and in addition the export path is not configurable yet (as described in brarcher/loyalty-card-locker#168) which doesn't allow to use synchronization software which works with folders (you don't want to share the sdcard's entire root where the export .csv file is saved). The latter can be worked around using the "send to" button, though.
A better option would be to sync the actual database. But there are a few issues preventing this:
-
The database path cannot be configured. Current path is /data/data/protect.card_locker which means that whatever software is trying to access that location to sync it to other devices, must run with root privileges. Making this path configurable or creating a copy of the database (updated on every change) in a user-accessible location would solve this.
-
The application must implement the reload-on-database-change function in order to load the changes made on the other device and synced back. Or, if we sync the database's copy in /sdcard, load that one when it's changed.
-
Conflict resolution (when two devices edit the databases while no data sync is happening between them). It is the most difficult part implementing which is probably not worth the trouble. Or maybe not? We can probably simply merge cards that are in /data with the updated version from /sdcard thus keeping added cards from both devices. Deletions and edits have to be additionally handled, though. "Newest change wins" principle? That will need a new "datetime changed" field for each record in the database if it's not there yet.
Then again, cloud sync for those who don't care to set up their own file sync solution? That might be planned for the future. That cloud subscription might (and probably should) be a paid one, earning something in addition to the donations :)