Syncing with SD card compared to how BitTorrent Sync did it

Hello there, I understand that like with most applications, it is impossible to write on the SD card with certain Android versions. However, I did manage to get BitTorrent Sync to sync a folder on the card in Android/data/com.bittorrent.sync/files. Now I’m trying to move from BitTorrent Sync to Syncthing in hopes of no longer having to deal with the numerous glitches BitTorrent sync anoyed me with. Can I do the same thing with Syncthing, or is it limited to internal storage completely? And what versions of Android have this feature available and which not?

Thank you in advance.

If you want to sync the files from your Android device to another, you can do that by manually creating the file .stfolder inside that folder after adding it to syncthing. And you should also set the “Master Folder” setting for the folder in Syncthing, so it will not try to write to the card.

If you want write access, you will have to have the current version of Android (6+) with the SD Card set as primary storage. That’s what I do on my Moto X Style.

Android 5 does have the possibility for Apps to write to the card by using a special API, but that API isn’t supported by golang.

Searching this forum will give you threads with more detailed info.

1 Like

Thanks, wweich. I want to write, so the trick of creating a master folder isn’t useful. So setting the SD Card as primary storage for Android 6+ actually allows writing on the card? I’ll look into that. So Android 5 doesn’t support that. I understand.

Thank you again for your help. I’m still curious how BitTorrent Sync wrote to com.bittorrent.sync. I’m using Android 4.4.2. Does BitTorrent Sync use that special API you’re talking about?

Most likely, it’s closed source so we don’t know for use.

As of Android 6.0 you can set the SD Card as the primary storage, which will result in the internal not being accessible anymore. So /storage/emulated/0 will be the sd card and the internal storage will only be used to install apps and (depending on the app or its settings) the app data. Everything else (including access for file managers) will be on the sd card. The sd card will be formatted and (afaik) encrypted, so it will only work in this device.

This is therefore only useful for devices with very small internal storage, or when using a big sd card. I’m using a 128GB sd card to complement my 32GB internal storage.

Yes, an app can always access the folder Android/data/*packagename*/files.

In our case, that’s Android/data/com.nutomic.syncthingandroid/files. We show that path in the folder picker for this reason. Any suggestions how we can make it clear that read/write is always supported on this folder?

Sorry for the late reply, things are busy at work. It’s great news that I can use the SD like I did in BitTorrent Sync. I somehow missed it being listed, unfortunately. Thanks!

Is it a way to make Syncthing to only read from my PC and never modify anything? BTSync is a pain when it decides to copy back on my PC from android stuff I wanted deleted.

You can use the master flag on your PC.

Oh, I remember. Sorry, I’ve been confusing features with the less than desirable BTSync. Can’t wait to fully migrate to Syncthing. Thanks!

I’m having a small issue. Two of my larger folders on android keep being scanned. I get 0 / 470 files and 0B / 13.6 GiB on one of them, and 4/3000 files with 27 MiB/16GiB at the other. Are the numbers not real and the scanning is actually happening, or does it mean I’m stuck?

Plus, it’s a pain to scan on android because after a while after the screen goes black and the phone is locked, the app appears to be closed. I’ve set it to always run in the background in the settings, but I still have this issue.

@MaxRavenclaw what Android version do you use? Android 6 has a pretty aggressive battery server which kills Syncthing, if the screen is off and the phone is not moved for a while. To prevent this, you need to enable the experimental wake lock setting and exclude Syncthing from Battery optimization.

1 Like

I’m using Android 4. And I imagine it’s Battery Doctor who does the killing in this case. Anyway, scanning worked after leaving it overnight. Now I just get another small issue. Devices sync for a few minutes, then disconnect, then sync again. Probably because my android is blocking. I’ll have to investigate, but if anyone knows anything, do tell. Thanks!

EIDT: Stopping the processor from stopping with the experimental settings seemed to have worked. Now I get another small issue. Every couple of minutes, despite everything being up to date before, one folder goes out of sync and I have to override, which if fine, but it happened three times already. There’s no scanning going on the android, so why does this happen?

Android by default uses inotify to know a file has changed and triggers a scan immediately.

Well, things seem to be working right now. Having arrived back home I didn’t get any out of sync messages for the past half an hour. I think I’m good. Thank you to everyone for the help.