Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable synchronisation of favourites #2750

Open
frobijn opened this issue Jun 26, 2016 · 50 comments
Open

Enable synchronisation of favourites #2750

frobijn opened this issue Jun 26, 2016 · 50 comments

Comments

@frobijn
Copy link

@frobijn frobijn commented Jun 26, 2016

(This request resembles #1613 but the export/import from that issue would not be sufficient)

This request: please make it possible to synchronize favorites among devices. This is not a request to implement the synchronization itself - I can understand that it is impossible for Osmand to support all possible solutions (external SD card, DropBox, OneDrive, Google Drive...). But the way Osmand handles favorites at the moment makes it very cumbersome to perform any form of synchronization, even with a third-party app. The request is to modify the Osmand behaviour to allow for easy synchronisation, and preferably allow automated synchronisation (e.g., via a third-party app).

Some background: I'm a huge fan of Osmand and I'm using it extensively on holidays. It's great to have an offline map/navigation app. I use the favourites a lot to mark the location of hotels, train stations and other points that I want to visit, have to change trains or buses etc. Especially in countries where you cannot read or understand the local language, having a map that tells you whether you are close to your target is very practical. So while traveling I tend to add, move, remove and rename favorites a lot.

I'm using Osmand on two or three devices (tablet, new phone for safe areas, old phone as backup and for less secure areas), more or less at the same time. The tablet is great for planning itineraries, the phones for navigation and ad-hoc route planning, and the tablet is also a backup in case the battery of the phone is empty. But then it should be easy to distribute changes to the favourites made on one device to the other two.

With the current Osmand version that is impossible, or at least it is a nightmare.

Exporting the favourites is possible. Go to the list of favourites and use the share option to export the file. It is possible to save the favourites.gpx to Dropbox, or to save the file to an external location (memory card/USB stick that is connected via USB). (It is not possible (on Android 5.x) to save the favourites to a file on the internal/external SD card, probably because of security issues).

The main problem is importing the favourites, because Osmand always prefers the data on favourites that is stored in its internal database. There are several ways to import the favourites.gpx:

  • Double-click the .gpx file. Osmand is one of the options to open the file, the select the option to import the file. This will import all favourites from the file, but the favourites already present will not be deleted or modified. You've got most of the favourites twice; only new or renamed favourites are present only onces, as are the favourites you wanted to get rid of. This is not the solution.
  • You can delete all favourites first. That's a bit of a nightmare, as you have to be very sure that you do not throw away any modifications that were not yet present on the other device. Then double click the .gpx file and import it. All favourites are present in the correct categories, but the colors associated with the categories are lost. This is not the solution.
  • Copy the .gpx file in the files directory of Osmand, force Osmand to stop, restart Osmand. Now all new favourites are present, but the existing ones are still present and they do not get updated as Osmand ignores the data for those in the .gpx file.This is not the solution.
  • Delete all favourites, save the .gpx file in the Osmand files directory, force Osmand to stop restart Osmand. This works!

The last one works, but it is quite cumbersome and there's plenty of room for error.

Personally, I would prefer a third-party app solution: create an app that synchronizes two versions of a favourites.gpx (allowing for changes in both versions), and updating the collection of favourites in Osmand. (I could make such an app, I've built similar software.) Such an app could automate the process, but... Osmand won't allow that. If only all favourites were writen to the favourites.gpx, then such an app could read the data without user intervention. If only Osmand would (have an option to) use the data from the external (favourites.gpx) file if it exists instead of from the internal data file, then modifications could be communicated automatically to Osmand. If only there was a way (e.g., via the Osmand api) to reinitialise the favourites from the external data, then such an app could do its work without the user having to force Osmand to stop.

@vshcherb
Copy link
Member

@vshcherb vshcherb commented Jun 27, 2016

OsmAnd doesn't delete missing favorites on purpose in order to not loose anything wanted. Full synchronization of favorites will require mechanism how user can undelete favorites and this is not discussed how to implement yet. Today it is possible to recompile osmand https://github.com/osmandapp/Osmand/blob/master/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java#L76
Another Workaround (OsmAnd stores 2 gpx files for favorites 1 on external sd card another in internal memory):
A) Delete internal GPX file
B) Synchronize internal GPX file as well

@frobijn
Copy link
Author

@frobijn frobijn commented Jun 27, 2016

I had already looked at the source code to figure out what's happening. Your suggestion for another workaround is indeed possible, but then I have to root all devices as an app or user can't access the internal file without root privileges.

@vshcherb
Copy link
Member

@vshcherb vshcherb commented Jun 27, 2016

Agree, we need to enable somekind of developer settings which will be easy to set in the app. One of that setting should be use only external storage for favorites, so it will be easy to synchronize.

@hieronymousch
Copy link

@hieronymousch hieronymousch commented Jul 28, 2016

+1 for me, would be a great feature

@PalatinateTom
Copy link

@PalatinateTom PalatinateTom commented Sep 2, 2016

+1 for me too - I plan on the tablet and bike with the phone

@epatpol
Copy link

@epatpol epatpol commented Mar 13, 2017

Friendly bump here (I also use it for both car driving and biking, so that would be really useful) +1

@pwiaut
Copy link

@pwiaut pwiaut commented Jul 3, 2017

+1 for me also, have it on three devices
there is 1 other navi app i'm aware off that offers such a feature, but for various reasons i like osmand better.
osmand provides a nice grouping feature as well. but even if you are willing to edit/merge/convert favourites witha gpx editor, handling of this information is quite cumbersome (at least i didn't find a good editor). another idea was to convert the GPX to chrome bookmarks, do cleansing there and convert back, hoping that i could convert bookmark folder to osmand favourite groups...

anyhow, getting a better synchronization would be more than "nice to have" for me.

@stephan75
Copy link
Contributor

@stephan75 stephan75 commented Jul 4, 2017

Maybe the following can be helpful:

See the latest new feature on https://overpass-turbo.eu ...

You can store now your queries in an API by openstreetmap.org!

That means: log in with your OSM account and have some storing space for small data sets.

Maybe it is possible to store the favourites.gpx file there as well?

@catr
Copy link

@catr catr commented Sep 26, 2017

Would be really interested to have this feature. Having the ability to move preferences/settings/favorites between devices will save users lots of effort with new or multiple devices.

@julius59
Copy link

@julius59 julius59 commented Oct 8, 2017

+1, this is really a missing feature.

@Friptick
Copy link

@Friptick Friptick commented Jan 1, 2018

This is the weakest link in Osmand, an otherwise amazing project. A lot of us are building huge GPX datasets and rarely backing them up, let alone syncing, because of this problem. Not only "nice to have" but needed urgently.

@SpcCw
Copy link

@SpcCw SpcCw commented Jan 31, 2018

I agree, it is something that has been missing for a really long time.

Optional sync of user data with cloud is almost the standard now and GPX are exactly the kind of data users need to sync and back up. It is accumulated sporadically and over long time, edited on different devices, not audited often and you usually can't predict when you will need to find that place you marked two years ago. Countless times I saved a POI just in case, long time passed, then I needed it - and of course it was on another device, lost due to device reset and/or my failure to back it up.

I would see it as optionally automatic Dropbox/Google Drive synchronization. Those who want to be extra careful about not overwriting existing GPX from the cloud can leave it off and keep doing it manually. Casual users will just turn it on and forget about it. Some people will combine the approach - setting up sync but periodically exporting GPX manually after important edits. I don't think undelete functionality is really necessary to implement before cloud sync.

@fabbra
Copy link

@fabbra fabbra commented Feb 21, 2018

+1, absolutely necessary for travelling

@mfs12
Copy link

@mfs12 mfs12 commented Mar 2, 2018

+1 would like to sync as well...

@Big-Iron
Copy link

@Big-Iron Big-Iron commented Mar 14, 2018

+1 absolutely necessary

@mtekman
Copy link

@mtekman mtekman commented Apr 24, 2018

+1 transitioning between phones is a pain, and loss of trek data hurts

@gropius365
Copy link

@gropius365 gropius365 commented May 8, 2018

+1 without this "favorites" are effectively tied to the device and are therefore temporary.

@MapMemoAlex
Copy link

@MapMemoAlex MapMemoAlex commented Jun 18, 2018

Very important for me, too. I have over 300 favourites which I use and change constantly and there is no way to sync them on different devices and no save place to store them constantly.
Favourites are of course a kind of private layer above the public informations but I think it is a very important layer. Historically OSM comes from public sharing, but not every favourite is worth being published and valid to be shared with everybody.

@rednaxela-work
Copy link

@rednaxela-work rednaxela-work commented Sep 3, 2018

+1 from me

@l0b0
Copy link

@l0b0 l0b0 commented Sep 5, 2018

PSA: Please avoid "+1" messages on GitHub issues, that's what the reactions (the "+" above comments) are for. Otherwise subscribers end up with a lot of pointless notifications.

@BengaloBongali
Copy link

@BengaloBongali BengaloBongali commented Sep 7, 2018

I tried to ask for this in #2636, but was misunderstood / didn't find the right words. All it'd take is to have seperate files for each favourite. Because these files are so small it could just be added and the favourites.gpx could be left as is. An additional folder "favourites" with subfolders of groups that would be in sync with the content of favourites.gpx and prioritized if there are conflicts. Could be an add-on "Favourite Sync Folder" or an option in the developer add-on.

P.S.: I can sync favourites.gpx itself, but this doesn't handle conflicts, if both devices add a favourite without being online.

@pwiaut
Copy link

@pwiaut pwiaut commented Jan 9, 2019

any updates on this request?
please!

@vshcherb
Copy link
Member

@vshcherb vshcherb commented Jan 11, 2019

Yes, it is planned for 2019

@vgdh
Copy link

@vgdh vgdh commented Mar 26, 2019

Please make synchronization.

@eneiluj
Copy link

@eneiluj eneiluj commented Aug 9, 2019

Hey! Nextcloud Maps development is currently in progress. There already is a REST API to manipulate favourites. It would be great to create an OsmAnd plugin able to sync favourites with Nextcloud Maps. Being able to sync with a privacy-friendly solution as Nextcloud Maps would be a killer feature IMHO.

This API has been discussed in nextcloud/maps#30

If I find time and motivation, I could do it in a few months. If someone wants to do it, feel free to ask for some changes in Maps favourites API if necessary.

@muglyObserver
Copy link

@muglyObserver muglyObserver commented Jan 10, 2020

I also have multiple devices running OSMand and keeping the favorites synced is very labor intensive. This would be a very nice feature to have.

@mtekman
Copy link

@mtekman mtekman commented Jan 10, 2020

Yes, it is planned for 2019

Any update on this, or a roadmap we can look at? (sorry to start 2020 with a push!)

@vshcherb
Copy link
Member

@vshcherb vshcherb commented Jan 10, 2020

Yes, it is in roadmap for 2020, for sure. We are looking to synchronize with profiles and everything.

@pebogufi
Copy link

@pebogufi pebogufi commented Jan 10, 2020

@vshcherb
Please make also a export / import or sync for private custom search filters. Until now they are the only one without any workaround for share / im-ex / sync among devices.
Thanks a lot !
Peter

@g-work
Copy link

@g-work g-work commented Feb 17, 2020

Sync with OsmAnd would be great!

@mfs12
Copy link

@mfs12 mfs12 commented Apr 13, 2020

As an easy workaround you can sync the favourites.gps file with a tool like syncthing. Syncthing allows you to sync folders in your android's filesystem to your PC. and there are probably many other tools which do a similar job.

@Friptick
Copy link

@Friptick Friptick commented Apr 23, 2020

Perhaps there is a misunderstanding here. As OP said:

This is not a request to implement the synchronization itself - I can understand that it is impossible for Osmand to support all possible solutions

And as @biiiep just said:

As an easy workaround you can sync the favourites.gps file with a tool like syncthing.

Really, that is not a workaround, that is the solution. Syncing should be left to a separate sync tool, not reinvented by Osmand. Favorites have a standard file format for data exchange: GPX. And already Osmand uses GPX for both favorites and markers. The favorites.gpx file is kept updated by Osmand, making it fine for one-way sync already. (Markers unfortunately still require manual export.) But OP seems to suggest that Osmand does not read the file, preferring an internal database.

So what is needed is simply for Osmand to keep the favories.gpx file fully synced with its internal database. Then users will be able to sync the favorites.gpx file using whatever sync tool they prefer.

Correct, @vshcherb ?

@BengaloBongali
Copy link

@BengaloBongali BengaloBongali commented Apr 23, 2020

Really, that is not a workaround, that is the solution.

It's neither a workaround nor the solution. That's what I'm doing until now, but it has too many limitations. Favourites are saved in one file. So all syncing conflicts will result in one of two changes being lost. Changing that is the whole point of this issue. To make it easily syncable, we'd need e. g. folders for favourites groups and one file for each favourite. That's what I was asking for in #2636.
(Optionally) storing these not in the app folder, but in a separate folder "Locations" on internal storage would even make it possible for other navigation apps to implement it the same way, so we could have consistent location favourites even across apps.

@pwiaut
Copy link

@pwiaut pwiaut commented Apr 23, 2020

@Big-Iron
Copy link

@Big-Iron Big-Iron commented Apr 23, 2020

Sorry, I can't understand the problem.
I synchronize twoway the files and folders I want from OSMAND with "OneSync" to my OneDrive.
All Android, iPhone and PC are every time the same.

@pebogufi
Copy link

@pebogufi pebogufi commented Apr 23, 2020

I also don't see a real problem. Only in three cases there is some manual work necessary

  • delete of one or more points
  • change of a point name which leads to "semi duplicates"
  • move of a point to a different group

Theese cases are not easy to handle programmatically, because it is not really clear, how the user wants this to be solved.

@BengaloBongali
Copy link

@BengaloBongali BengaloBongali commented Apr 23, 2020

Sorry, I can't understand the problem.
I synchronize twoway the files and folders I want from OSMAND with "OneSync" to my OneDrive.
All Android, iPhone and PC are every time the same.

Have two devices offline. Add an individual favourite on each. Go online with both.

@pwiaut
Copy link

@pwiaut pwiaut commented Apr 23, 2020

@j-schneid
Copy link

@j-schneid j-schneid commented May 2, 2020

...
Another Workaround (OsmAnd stores 2 gpx files for favorites 1 on external sd card another in internal memory):
A) Delete internal GPX file
B) Synchronize internal GPX file as well

Where is this internal file? Even on my rooted device (Android 6.0.1, osmand+) I can't find it. This would help as a workaround, as I don't have much hope any solution is going to be implemented any time soon.

@tacruc
Copy link

@tacruc tacruc commented May 11, 2020

Hey! Nextcloud Maps development is currently in progress. There already is a REST API to manipulate favourites. It would be great to create an OsmAnd plugin able to sync favourites with Nextcloud Maps. Being able to sync with a privacy-friendly solution as Nextcloud Maps would be a killer feature IMHO.

This API has been discussed in nextcloud/maps#30

If I find time and motivation, I could do it in a few months. If someone wants to do it, feel free to ask for some changes in Maps favourites API if necessary.

Is it possible to integrate the favorit sync as an own app? I'm unshure about the OSMAnd-API https://github.com/osmandapp/osmand-api-demo. There are a bunch of methods discribed to add and modifify favorits. This would be enough to get the Nextcloud maps favorits into OSMAnd, but I'm missing functions to get the favorits or get notified if favorits change to upload them to nextcloud.
Any suggestions?

@vshcherb
Copy link
Member

@vshcherb vshcherb commented May 11, 2020

It is possible to add these API methods, I think there are methods to get favorites or probably we can introduce 2 methods - "Last time favorites has changed" + "Access to raw Favorites.gpx.gz"

@tacruc
Copy link

@tacruc tacruc commented May 11, 2020

How diffecult would a
registerForFavoritsUpdates
be? Would be more efficient otherwise the app would need to pull with a certain intevall, or?

@vshcherb
Copy link
Member

@vshcherb vshcherb commented May 12, 2020

if app is running obviously it is eaiser and should be done though 2nd periodic check on start still need to happen

@vshcherb
Copy link
Member

@vshcherb vshcherb commented Jun 14, 2020

@vshcherb
Copy link
Member

@vshcherb vshcherb commented Jun 14, 2020

There is some progress made in another issue - #7690

@Spartachetto
Copy link

@Spartachetto Spartachetto commented Jul 11, 2020

I don't know if you are aware of it, but if/when OSMAnd will have this kind of sincronization, maybe it could be listed also in the Nextcloud appstore: https://apps.nextcloud.com/

This thaks to nextcloud/appstore#95

This would not mean that the users could install OSMAnd via the Nextcloud appstore, yet for sure it would be another way to gain new users via the awareness of OSMAnd existance and capabilities.

@Boothy99
Copy link

@Boothy99 Boothy99 commented Aug 9, 2020

Just a thought ... but in the interim whilst this is hopefully being sorted -
Would it be easy / relatively simple for an upcoming version of OsmAnd to include a "Select All" button / icon somewhere in the "My Places" section, AFTER clicking on the "Bin" icon (next to the Bin at the top)?
That way, we wouldn't have to click on each individual Favorite group before deleting, prior to importing the newer favorites.gpx. I've ~ 50+ groups to delete individually and on occasions, I accidentally miss the tick-box and cause the list to pop open, making deletion even more frustrating.
Just a thought 🥴
👍

@dbogdanov
Copy link

@dbogdanov dbogdanov commented Aug 18, 2020

I have the same issue. The internal database should update itself with respect to the changes in favourites.gpx.

@39aldo39
Copy link

@39aldo39 39aldo39 commented Sep 5, 2020

Might I propose a solution based on DecSync? I uses the filesystem to synchronize the favorites, like others suggested. But it is designed in such a way that there are no file conflicts.

Disclaimer: I made it myself.

@39aldo39
Copy link

@39aldo39 39aldo39 commented Dec 11, 2020

I have now actually made a proof of concept of OsmAnd DecSync, which is an OsmAnd plugin that uses DecSync to synchronize the favorites! Note that it is a proof of concept, as it requires root and heavy manual intervention, as there is currently no way for a plugin to access the favorites.

To make it work correctly, this access has to be added. It is sufficient to add a method to get the time of the latest update and a way to access favourites.gpx, as was proposed previously.

Furthermore, the plugin makes use of ids to identify favorites and categories, but OsmAnd cannot store them. Is is possible to add this possibility? Currently, the plugin guesses based on the name,color etc., but storing it directly would make it simpler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet