Android (background) sync interval

This will be great. No need to manually sync again

1 Like

Any word or method found to make this happen?

1 Like

I’m working on this, no estimates though.

2 Likes

Thank you! I wish you the best of luck!

Was anyone able to make some progress on this? I’m a new user still evaluating Joplin to replace my Evernote usage, and my mobile devices are all Android, so background sync is mission critical for me. I haven’t done too much React development, but I’d be very willing to contribute some code for this. I love everything else about Joplin so far, and I was quite surprised to find that background sync is not already a feature for all platforms, particularly Android.

Well I did make some progress, but I am not longer working on this.
Doing it properly requires changing the core parts of Joplin significantly, and I am just not interested in doing that.

Maybe I’ll just rewrite it in Java to work natively on Android.

I would be willing to contribute to a rewrite as well. I don’t mean to swoop in from nowhere and judge anyone’s work, but it seems that ā€œReact Nativeā€ does not really do what it says on the tin, and lack of background sync is a serious limitation. I want to be able to rely on my reminders to synchronize automatically, not worry that I’ll miss something important because I forgot to open the Joplin app on each device every day. Everything else about Joplin so far makes it perfect for an Evernote replacement, so I’m quite invested in the idea of making background sync a reality!

@laurent, do you have a particular leaning on the subject of an Android client rewrite?

There's GitHub - transistorsoft/react-native-background-fetch: Periodic callbacks in the background for both IOS and Android which works (on Android at least).
The issue is, in my view, that for this to work you essentially need to run another headless Joplin process and the current code is too tightly coupled to UI.

a work-around until this can get resolved is to use one of the macro type apps to load Joplin and trigger a sync periodically. I have mine do it twice a day. Not a great solution, but workable.

That’s a great idea! I’d be interested in an app recommendation if you have one. I’ve tried many over the years, but have never found a truly reliable scheduler/macro program for Android

this is what I use. https://www.macrodroid.com/. i prefer this over tasker, but it’s just my preference. there are a few other macro type apps, but i haven’t tried them.

What issue did you get exactly when you've tried this? The sync service is not tied to the UI since it's meant to work with CLI, desktop and mobile UI or even with no UI (in headless).

That doesn't seem realistic to be honest. It would take many months to fully re-implement all of Joplin core functionalities and even then, there would now be two core to maintain - one for Android, and one for all the other apps. And we don't have an army of developers to maintain this :slight_smile:

The only way to keep things maintainable is if you can re-use the existing core library via a JS engine. But that's what React Native does, so again it wouldn't make much sense to do this.

I don’t remember the exact issue.
Had a quick look now and I can see synchronizer depends on dispatcher and in root.js where dispatcher is created there are lots of classes using statics (or whatever they are called in Javascript) and so the whole initialization seemed hard to untangle.

I tried to do this but have lost interest eventually (it does not help that Javascript is not a nice language to work with),

Ok I see. In fact the dispatcher is optional, it’s essentially a mechanism to send messages to the UI, but if it’s not initialized it simply does nothing. There might be other issues though, like getting the sqlilte database to work from within the background process, or reading/writing resource files from the disk.

I have an idea on how to make this work.

Have a setting in the Joplin app which is only available when your sync folder is a local folder and not a cloud storage folder which is to be able to sync constantly. This will ensure the Joplin app is syncing with the local folder on the phone and is always up to date.

Then someone can make another app that could be called "Joplin Sync" which will sync a local folder to the cloud and back and you can set sync intervals, it can run in the background.

This way Joplin does not need to rewrite its mobile app from scratch and you can have a background sync b installing an additional app and using a folder on your phone to sync the notes to. When I used Syncthing to sync my notes which means I used the local folder sync option. It we blazing fast for the Joplin app to sync compared to using any cloud service since it did not need to connect to the server, talk to the server and work it out.

This exist already.
Use "filesystem" as sync source in configuration.
And then let to sync this folder by any other existing sw - e.g. Syncthing
When you open Joplin, the sync against local folder will be almost instant...

Yeah but there are no apps I find that are free, open source, available outside of Google Play Store that can sync any folder 2 way on your phone to a variety of cloud service

  • nextcloud - f-droid
  • syncthing - f-droid
  • synctool - f-droid
  • Synchronize Ultimate - apkmirror - extensive list of supported cloud storage services

How much time did you spend searching?

1 Like

Nextcloud - Does not support 2 way sync in Android app
Syncthing - Not a cloud service, it is P2P
Synctool - Does not support many cloud storage providers
Synchronize Ultimate - propietary & closed source

I did not see Synctool or Synchronize Ultimate. If you find anything else please let me know and I will take a look at them

1 Like