owncloud / android

:phone: The ownCloud Android App
GNU General Public License v2.0
3.85k stars 3.06k forks source link

Two way sync - potential solution #1882

Open tester16 opened 7 years ago

tester16 commented 7 years ago

Actual behaviour:

Expected behaviour:

Potential temporary solution:

A free third-party app Tasker (https://tasker.dinglisch.net/) is capable of: 1) running a background service monitoring changes in files and folder, 2) sending different types of intents.

  1. Would it be possible to send an intent to the ownCloud client forcing upload of a single file?
  2. What is the intent and syntax of the additional data that needs to be provided for a successful request (I assume at least the local path to the file). After brief analysis of the code I found this: com.owncloud.android.files.services.FileUploader, but I am not sure if this is the correct one.
KuenzelIT commented 7 years ago

How is the current situation with two way sync? I read some issues about this topic, but it's still not clear.

davivel commented 7 years ago

Files in a folder set as available offline or set as available offline themselves are automatically uploaded if updated.

Files added to a folder directly (via file browser, not through the OC app) are not uploaded. We could consider implement this.

Files deleted from a folder directly (via file browser, not through the OC app) are not deleted from the server. I don't think we implement this, because it clashes with the capability to have files not downloaded but still accessible via the app, that we want to keep.

KuenzelIT commented 7 years ago

Sounds complicated and I assume you have your reasons for this. Still the same functionality as with the desktop app would be nice, just a complete two way sync.

davivel commented 7 years ago

@KuenzelIT , sorry, but the scenario in mobile is different than in desktop. In mobile we can't take as granted the existence of any concrete file browser in the device, hence that the mobile apps provide its own browsing UI, while desktop client doesn't, and use it as primary source of input.

While there are many people that actively use file browsers in their mobile, there are many others that do not even know they exist. That's the reason why we shouldn't move the mobile apps to the same approach as desktop apps.

Nevertheless, we will keep on extending the behaviour to get near of desktop syncing, as they do in the opposite direction. The answer is in the middle, the Virtual Filesystem. Getting there.

CraftingGamerTom commented 4 years ago

Status update on this for 2020? I'm interested in getting files syncing rather than just "available offline".

I do not think it is ideal to design and decide to not make features for user's who do not know a file system browser does not exist as many owncloud user's do know if it exists. Perhaps we can create a new section entirely for "Auto Sync" rather than available offline where users can decide where on their internal storage or SD Card they want to store files being synced with their cloud - similar to desktop. It would just be a page with many settings, not a way to view the files - also similar to the desktop sync apps.

There is much more thought and design needed for this than I included above but I was really only meaning to comment the first part of this but got mentally carried away

rt87 commented 3 years ago

+1 for a 2-way-sync

michaelstingl commented 3 years ago

Pleas check FAQ: https://doc.owncloud.com/android/faq.html#detect-and-upload-changes-from-local-file-system

Sadly there is no bright future for file operations on the devices file system in the Android world. (Similar what Apple does forever)

rt87 commented 3 years ago

I see... well at least for my personal purposes, it would not need to be a "live" sync, i.e. I dot NOT want to work on some file and "instantly" see the changes when I change devices, i.e. from mobile to desktop.

My use case: Sort of a "devices data merge + backup" for, e.g., photos. So say I have two android devices, I would like to automatically sync my photos between them, i.e. device A uploads its new pictures and, at the same time, downloads the latest pictures which have been uploaded from device B (and vice versa, obviously).

In that context, I would be content with being able to do this cron-job style, e.g. executing that 2-way-sync once per hour/day or so. However, I would hate to have to hit a button every single time for the sync to occur, because, let's face it, I would simply forget to do so (and even if not, it would still be annoying)!

michaelstingl commented 3 years ago

This should totally work with the "available offline" feature. Auto-upload images to this folder, and mark this folder as "available offline" on both devices. This can can be accessed via the Document Provider Integration from all other apps.

Only problem is directly operating on the raw file system of your device, but looks like this isn't a requirement in your case.

I hope automation apps like Tasker will support system-wide Document Provider in the future, to allow more advanced workflows.

rt87 commented 3 years ago

Ah, sry, I'm afraid you lost me there, a little bit at least.

Only problem is directly operating on the raw file system of your device, but looks like this isn't a requirement in your case.

I'm unsure what exactly you mean by this, "raw". I usually do not edit any of the files in question, but might on rare(!) occasions, if that is what you meant.

I hope automation apps like Tasker will support system-wide Document Provider in the future, to allow more advanced workflows.

Sadly, I'm unfamiliar with Tasker and what it does, I might need to read up on that one...

In addition: How often would that "offline available" sync occur? Can I change that, if needed?

Huge thanks btw, this is already quite helpful!

jesmrec commented 2 years ago

Scoped Storage implementation does not allow to update files out of the oC app or the document provider. Therefore, there is no way to update files in background by using 3rd party apps. We will check further scenarios.