quill icon indicating copy to clipboard operation
quill copied to clipboard

Allow syncing in the background

Open vickychijwani opened this issue 9 years ago • 3 comments

Until this is implemented, there will always exist a high possibility of bugs like this:

  1. User makes significant edits to a post
  2. A phone call comes in, app goes to background, edits are saved but not synced to the server
  3. User does not open the app for several days
  4. In that period, someone else (or this same user) makes some edits to the same post through the web interface -- at this point the user may notice their several days old edits have not appeared yet!
  5. Now the user opens the app and a sync occurs -- this will end up overwriting the remote copy with edits in step 4 with the old edits!

Concerns to take care of:

vickychijwani avatar Sep 01 '15 09:09 vickychijwani

This sample offline architecture may help (presented at the Android Dev Summit architecture talk): https://github.com/yigit/dev-summit-architecture-demo

vickychijwani avatar Dec 10 '15 20:12 vickychijwani

Removed from 1.0 as this is a pretty big change.

vickychijwani avatar Apr 27 '16 18:04 vickychijwani

GCM Network Manager looks like the best way to do this: it's convenient, flexible and conserves battery. Here's a great overview: https://www.bignerdranch.com/blog/optimize-battery-life-with-androids-gcm-network-manager/

It should be noted that with GCM moving over to Firebase, the GCM Network Manager will eventually be superseded by Firebase Job Dispatcher.

UPDATE: Yigit Boyar's Priority JobQueue library might also be helpful.

vickychijwani avatar May 24 '16 14:05 vickychijwani