Writing to external SD card in Android 5.0 and above

Being on Xiaomi mi8, I can sync /storage/emulated/0/DCIM with readwrite. I even have full access to /storage/emulated/0 and sync that in both directions. On sdcard, /DCIM is read only, so that’s where I think your statement fully applies.

1 Like

@Catfriend1 Exactly. And given that older phones at least are space constraint, hence relocating DCIM to the SD card is a very common operation. Syncing this folder would give a beautiful workflow: delete unwanted pics and relocate valuable pics to different folders on the PC, and a sync would clean up DCIM automatically. IF only Google wouldn’t be such a PITA.

Google don’t care about DCIM on SD cards, because their phones don’t have a SD card slot. For (about) the same reasons, they prioritize GO language extensions, that don’t buy them much…

Of course, advanced users could use this pattern much more widespread: I used to sync ebooks, mp3, business docs, source code, but the whole SAF disaster spoils the fun, and syncthing (usage) is the victim.

Given, that typical folders in emulated (builtin) storage don’t need the SAF, the whole security blather is pretextual for their own advantage.

In fact, using syncthing on portable devices has some other trade offs (energy-wise), but this very issue is enough to not even care/report about the other issues, because it broadly limits syncthing’s usefulness on such devises.

I’m back to oldschool cut’n’paste on a case by case base, because of this at least (while I’m using syncthing successfully in many other use cases, btw).

2 Likes

To make external sd card access, syncthing-android should move from syncthing binary to syncthing library with extended api to call file IO’s. gomobile build should be a build utility. I’ve done for android torrent using torrent go library.

Sure, that’s what should happen, sadly nobody has enough time, ambition or knowledge to do this.

This is quite a shame, it’s the one thing holding me back from being able to completely switch from Resilio Sync. Dammit google.

As I understand it, the two primary proposed solutions to this point are:

  1. Implement syncthing natively in Java/Kotlin and use SAF to prompt the user for access to the SD root, and to access files and directories.

  2. Create a thin layer in Java/Kotlin which uses SAF, and use some sort of socket or pipe protocol to interface with that layer from Go.

Unfortunately, from watching this video (relevant part linked, but the whole thing is very informative): https://youtu.be/UnJ3amzJM94?t=1193

It appears to me that neither approach will yield a solution, because GOOG explicitly does not want people using SAF for broad file access. I think the only solution is getting approval for “All files access”, which according to the video doesn’t sound very easy. I do think there’s a good chance syncthing could qualify though.

What’s worse, I’m pretty sure these issues aren’t just going to affect SD cards. If I understand correctly, these enforcements are coming to internal/external storage as well. Am I missing anything?

I used sync thing at Android 9 (MIUI Version) and was surprised hat the SD-Card problem was gone. Why worked it at android 9?

Thought hat this problem was solved with android 9, but since the todays upgrade to android 10, I can not sync to the android device again. :unamused:

In MIUI is no option to format the sd as internal storage ?

There is no other way to fix it currently?

No, there is no workaround.

On my device, I can not format the storage as internal. :frowning:

Is excluding folders not possible too? It is greyed out in the android app.

I still wonder why it worked before the android upgrade.

Sadly, ignores don’t work either, as it’s written to a file in the directory, which doesn’t work if you don’t have write perms.

I have no idea why it worked before, but I guess it it should not have, and it’s not really a question we can answer.

I could create the exclude file with an editor, but it is obviously not so easy? Someone know an open source alternative, which supports external sd cards?

Damn, syncthing would be perfect. :cry:

You can create the file externally, it should work fine as long as syncthing can read it.

1 Like

Ok, I need support for external SD cards, hope that it can be implemented in the future. :roll_eyes:

With the exclude file, I can use it temporarily.

We all need many things, sadly some things are just not meant to be. This might get fixed in android 11 supposedly, yet I am skeptical.

4 Likes

I know, just hoping:thinking:

The workaround setup with three sync folders looks like this:

/storage/emulated/0/
/storage/<sd-card>/
/storage/<sd-card>/Android/media/com.nutomic.syncthingandroid/files

Excluded:

Android
...

Can watching three folders have a significance affect on speed and battery life? I need to test it anyway.

1 Like

Does Syncthing work in Adaptable Storage when using the SD Card as your internal storage?

If you’re looking for a more recent Android compatibility thread.

Yes.

1 Like

Is the storage access problem still with android 13?

It works well for me with the Syncthing-Fork app from F-Droid on Android 13:

  • One has to select every directory manually on the initial setup but read and write access is possible - also when the directory is on the SD card. No root access is required for this.
  • It may not be as fast as ever but it is fast enough. (I’ve never used Android 11 myself, only older and newer versions. However, I’ve read that Android 11 introduced a severe performance regression but it seems fixed in later Android versions.)
2 Likes