Does background sync work for anybody on Android

Operating system

Android

Joplin version

3.4.7

Sync target

Dropbox

What issue do you have?

Joplin does not get battery optimized it is configured to periodically sync, yet it never sinks not once ever. I've been using it for about six months. If I have it in the foreground it will start sinking and as soon as I switch out or the screen turns off it'll stop sinking

1 Like

Background sync on mobile is not supported, so the app always has to be in the foreground to sync. It’s a long requested feature, but unfortunately it is difficult to implement reliably due to using React Native for the mobile apps, unless implementing a load of native code in the app wrapper. But that would likely require more time and effort for ongoing maintenance, in addition to the initial implementation of the feature.

3 Likes

Thanks, but if that is the case what are the “Syncronisation Interval” & “Syncronise only over WIFI connection” settings for?

Those settings still only apply while the app is in the foreground.

It’s also worth noting that the ‘synchronisation interval’ is a periodic sync to ensure incoming changes are automatically downloaded while the app is continuously open, when there are no outgoing changes pending. Outgoing changes will automatically trigger the sync after 1 second on mobile, which is intended to help reduce the possibility of conflicts, due to the lack of background sync support.

1 Like

For a first time sync you can better use an app like Caffeine to keep the screen on until the sync is done.

After that it works like a breeze. I have +3000 notes or so. Use Joplin for a little year or so, without any issue.

Sync is set in my device to 5 minutes, auto, fail safe. Rest is default.

2 Likes

I turn on the developer mode "Stay Awake" and then keep it plugged in. As long as it's plugged in it won't go to sleep and Joplin will stay in the foreground and sync as long as it takes. This way you don't need to load anything special to keep it going.

3 Likes

There is no option to keep screen on while in app, we should not need etc party app for that. It also syncs way more than it should need too. I have lots of notes, make a handful of changes and it wants to sync 10, 000+ items…

Just use developer mode as described. It has a keep the screen on mode while the power cord is plugged in.

If you've never used developer mode go to

Settings-About-Software Information

Find the item labeled "Build number"
Tap it 7 times in a row. This turns on developer mode
Now go back to Settings and scroll to the bottom. You will see "Developer options".
Tap that and on the next screen you will find "Stay awake"
Turn it on and leave your device plugged in. The screen will dim eventually but stay on and Joplin will remain in the foreground and the sync can proceed until it finishes.

2 Likes

I point again to Caffeine on Android. It is a very easy “on/off” setting because it resides in the drop down notification bar. For those occasions that you need an app stay focused (it happens also on large sync jobs for cloud services too), it is really handy to have it on. And off again, without having to dig into dev mode.

Would it be possible to create a native Android app that has the single responsibility of syncing data in the background?

@clarkras Not really. That would only work with file system sync, as app data is isolated to the app which owns the data on Android. For file system sync, you already can use other apps to sync the data to the cloud, which may be done in the background, depending on the app

Syncthing seems to be the app mentioned most often for achieving this. There doesn't seem to be a good file system sync solution for iOS though. Has anybody tried Synctrain in conjunction with Joplin (or any other file system sync method for iOS)?