HowTo: sync favourites between devices with Syncthing

107 views
Skip to first unread message

A Thompson

unread,
Jan 12, 2020, 8:19:02 PM1/12/20
to Osmand
It used to be that the favourites.gpx file was only ever written, not read, by OsmAnd. But now on a full OsmAnd restart it is imported. This means you can sync your favourites between devices by syncing the favourites.gpx file. I've been using Syncthing https://syncthing.net/ (free, open source) successfully.

If you use a file manager to open a .gpx POI file with OsmAnd, and choose to import as favourites then OsmAnd adds the contents intelligently to your existing favourites, preserving categories and avoiding duplicates. It seems that on startup it now imports favourites.gpx in the same way. Thus, by syncing favourites.gpx between devices you can sync additions to your favourites, but you still need to make any deletions manually on each device.

Syncthing works between folders, but these can be in different locations. I've been syncing favourites.gpx between an Android 4.4 OsmAnd installation on a phone's SD card, and the built-in storage of an Android 9 tablet. To sync only favourites.gpx, not the whole folder, then Syncthing's ignore pattern for the folder should be:

!favourites.gpx
*

(This resides in a text file called .stignore that you can create in an editor or during setup of the synced folders in Syncthing.) See "Ignoring files" in the Syncthing documentation.

Other than choosing to start Syncthing automatically on device boot, I've been using all default settings. This means only syncing while on WiFi. If you add to favourites on multiple devices while they're unconnected, there will be a conflict that Syncthing handles. But if you do it while they're connected there's no problem: on the next full restart of OsmAnd each device will see all of the newly added favourites.

I hope this is of interest to someone, and as ever thanks to the devs: I've been wanting to be able to do this for ages!
 
 
 

J Albrecht

unread,
Jan 17, 2020, 8:27:07 PM1/17/20
to osm...@googlegroups.com
Thanks for your “Syncthing” explanation, A Thompson (particularly the point about the .stignore file!). If I can get this to work, it will be an ideal solution for my wife and I to be able to share POI’s with each other. Alas, it’s not working for me. 

Since I don’t have enough storage capacity on Internal Memory, I have no choice but to store all of OSMAnd’s data on my devices’ external SD cards. Unfortunately, Syncthing only has readonly access to this location. As a result, changes can’t be synchronised.

With the above in mind, can somebody perhaps suggest a viable workaround?

In an ideal world, we’d be able to stipulate where the favourites file can be saved to and accessed from. In my case, that would be anywhere on my devices where I have readwrite capability.



-------------------------------------------------------------------
signature.asc

Peer

unread,
Jan 18, 2020, 5:10:20 AM1/18/20
to Osmand

I did have a similar but slightly question.

With the app App2sd you can link the internal map with the map on the sd-card. When you copy a file to the internal map and Apps2s lets you see it in the external map also. I think your phone has to be rooted for this app.
I tried it briefly and it works on my pc.

I use the ssh Server App form Banana Studio to copy files from my pc to my phone. This app is able to copy to my sd-card directly. 

Op zaterdag 18 januari 2020 02:27:07 UTC+1 schreef J Albrecht:

J Albrecht

unread,
Jan 18, 2020, 11:33:17 AM1/18/20
to osm...@googlegroups.com
Thanks for your input, Peer. 

I now have full synchronisation of my “Favourites” across all of the relevant Android devices :-)  I was able to do this after installing “Apps2SD PRO” to my rooted devices and running the ’SDFix’ option. 

Furthermore, I’ve also synchronised “favourites.gpx” to my desktop. While this provides a backup by way of the Mac’s “Time Machine”, I had also wanted to be able to edit the POIs on Google Earth. This would be much more convenient than doing it on a ‘droid. However, Google Earth’s .gpx import doesn’t (or at least “didn’t” in my case) appear to preserve the folder structure; the POIs are no longer separated into the OsmAnd-specified “Categories”. As a result, I’m currently unable to effectively edit the favourites file as desired.   Does somebody know of a way to edit favourites.gpx externally while maintaining “Categories”?
signature.asc
Reply all
Reply to author
Forward
0 new messages