Skip to content

Simultaneous usage on two or more devices: thoughts #20

@TheLastProject

Description

@TheLastProject

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:

  1. Edit cards on device 1
  2. Export on device 1
  3. Sync with your favorite file sync software
  4. 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:

  1. 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.

  2. 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.

  3. 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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: help wantedI looked into this issue but couldn't solve it quicklytype: enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions