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

Closed
frobijn opened this issue Jun 26, 2016 · 73 comments
Closed

Enable synchronisation of favourites #2750

frobijn opened this issue Jun 26, 2016 · 73 comments
Labels
Nice to Have Should be fixed but there is no priority or no possibility to fix it within current horizon planning

Comments

@frobijn
Copy link

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

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

@vshcherb vshcherb added the Nice to Have Should be fixed but there is no priority or no possibility to fix it within current horizon planning label Jun 27, 2016
@frobijn
Copy link
Author

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

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

+1 for me, would be a great feature

@PalatinateTom
Copy link

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

@epatpol
Copy link

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 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

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 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 commented Oct 8, 2017

+1, this is really a missing feature.

@Friptick
Copy link

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 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 commented Feb 21, 2018

+1, absolutely necessary for travelling

@mfs12
Copy link

mfs12 commented Mar 2, 2018

+1 would like to sync as well...

@Big-Iron
Copy link

+1 absolutely necessary

@mtekman
Copy link

mtekman commented Apr 24, 2018

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

@gropius365
Copy link

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

@MapMemoAlex
Copy link

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

+1 from me

@l0b0
Copy link

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 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 commented Jan 9, 2019

any updates on this request?
please!

@vshcherb
Copy link
Member

Yes, it is planned for 2019

@vgdh
Copy link

vgdh commented Mar 26, 2019

Please make synchronization.

@julien-nc
Copy link

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

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 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!)

@Boothy99
Copy link

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

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

@39aldo39
Copy link

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

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.

@39aldo39
Copy link

@vshcherb Any update on the introduction of the methods "Last time favorites has changed" and "Access to raw Favorites.gpx.gz"?

@khimaros
Copy link

@39aldo39 -- it is actually possible to configure OsmAnd to write its data to shared memory which is accessible by other apps without requiring root access. Settings -> OsmAnd settings > Data storage folder > Shared memory. this is what i use in order to do synchronization with syncthing.

@frobijn
Copy link
Author

frobijn commented Sep 18, 2021

@39aldo39 -- it is actually possible to configure OsmAnd to write its data to shared memory which is accessible by other apps without requiring root access. Settings -> OsmAnd settings > Data storage folder > Shared memory. this is what i use in order to do synchronization with syncthing.

Indeed, this provides one-way synchronization. The favourites.gpx file is updated every time a favourite is added/modified/deleted, so the OsmAnd favourites can be shared with other applications via this file. The other direction (updating favourites in OsmAnd without user interaction) is still not possible in an automated way.

@39aldo39
Copy link

@39aldo39 -- it is actually possible to configure OsmAnd to write its data to shared memory which is accessible by other apps without requiring root access. Settings -> OsmAnd settings > Data storage folder > Shared memory. this is what i use in order to do synchronization with syncthing.

Thanks for the information! I would still prefer it if it wasn't necessary, but it is still acceptable. I updated the plugin to work using the shared memory functionality! The setup is a bit more complicated, but after that it should work automatically. I have even published a v0.2 release with an APK to make it easier to try out!

@DamianoPantani
Copy link

Same problem. I wrote a node.js utility that converts my Google Earth favorites into GPX, then pushes to /files/favourites.gpx and /files/tracks/, but indeed, in order to simply update icon color you have to first remove existing favorite.

PROPOSED SOLUTIONS:

  • expose favorites DB, so we could just remove the file (either manually, with adb, or other tool)
  • add support for /files/commands.txt - upon app load commands would be executed, e.g. WIPE_FAVORITES_OUT would clear your favs
  • add another tag support to <extensions>, e.g.
<extensions>
  <osmand:background>circle</osmand:background>
  <osmand:action>REMOVE</osmand:action> // or UPDATE, whatever
</extensions>

@vshcherb
Copy link
Member

@DamianoPantani what if you move them to a category called trash and keep it disabled? yes, we also could treat special coordinates to delete points like lat/lon=0.0001/0.0001 or tag in extension

@DamianoPantani
Copy link

@vshcherb that would do the trick but I can only move favorites manually. Can I do it from the favourites.gpx level?

@vshcherb
Copy link
Member

Hm... than I think I'm wrong with that idea and it needs to be implemented first.

@Rowin63
Copy link

Rowin63 commented Jan 31, 2022

Another year, same question:
I read all posts until here - but I still do not understand, if there will be a "real" syncronizing functionality (not just copying the favorites-file from A to B and back) coming? Stuff it in the "pro"-subscription, I would take it. But not having a real sync option is one of the bigger issues osmand has.

@vshcherb
Copy link
Member

Depends what's real and what's not real synchronization, updating / adding points - works but deleting points is not yet.

@scaidermern
Copy link
Contributor

scaidermern commented Jan 31, 2022

Meanwhile OsmAnd has a backup/restore feature and OsmAnd Pro has a cloud feature. So technically you can just backup your favorites (or tracks, markers, settings, ...) on one device to the cloud and restore it on another device from the cloud. This is quite similar to a synchronization.

If deletion doesn't work yet this is a pity, though.

@vshcherb
Copy link
Member

Once we implement timestamp tracking / deleting points / incremental synchronization, all possible solutions will benefit from it.

@Rowin63
Copy link

Rowin63 commented Jan 31, 2022

Meanwhile OsmAnd has a backup/restore feature and OsmAnd Pro has a cloud feature. So technically you can just backup your favorites (or tracks, markers, settings, ...) on one device to the cloud and restore it on another device from the cloud. This is quite similar to a synchronization.

"quite similar" is ecactly not "my" definition of "real" sync. For just copying files around I dont need a "pro"-version, using the osmand cloud.

@george-andrei
Copy link

I would like to add that a sync feature would also allow to share favorites with a partner. Are there other people interested in an integration with next cloud?

@Rowin63
Copy link

Rowin63 commented Dec 3, 2022

I would like to add that a sync feature would also allow to share favorites with a partner. Are there other people interested in an integration with next cloud?

I´m interested in every solution that will give me the possibility to sync favourites - and in the best case also tracks - between cloud and my devices!

@Friptick
Copy link

Friptick commented Dec 3, 2022

OP still has the best idea to begin resolving this whole issue:

The favourites.gpx file is updated every time a favourite is added/modified/deleted, so the OsmAnd favourites can be shared with other applications via this file. The other direction (updating favourites in OsmAnd without user interaction) is still not possible in an automated way.

Forget database access, and ADB, and anything Nextcloud-specific, for now.

Just make favourites.gpx and any other tracks writable from outside the app. In other words, link them directly to the state of the DB. Caching where necessary, of course.

@scaidermern
Copy link
Contributor

Just make favourites.gpx and any other tracks writable from outside the app. In other words, link them directly to the state of the DB.

There is one large drawback: OsmAnd only adds favorites from this file but never deletes them if they aren't contained in favorites.gpx.

@Friptick
Copy link

Friptick commented Dec 4, 2022

There is one large drawback: OsmAnd only adds favorites from this file but never deletes them if they aren't contained in favorites.gpx.

Yes, that was exactly my point... If favourites.gpx is used to store the state of the POIs, either instead of the DB or in regular sync with it, then what you see on the screen will always reflect what is in the file.

@george-andrei
Copy link

Yes, that was exactly my point... If favourites.gpx is used to store the state of the POIs, either instead of the DB or in regular sync with it, then what you see on the screen will always reflect what is in the file.

Could be a good start indeed, I will have a look at the favourites.gpx and see what information is possible to parse.

@twixi
Copy link

twixi commented Dec 26, 2022

im wait sync too

@xeruf
Copy link

xeruf commented Apr 17, 2023

Hey! Nextcloud Maps development is currently in progress.

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.

@julien-nc I would love that, any way I can support?

Similar discussion is ongoing for Organic Maps, if both implement sync I would be one very happy deGoogler :)
organicmaps/organicmaps#622

@dmpr0 dmpr0 closed this as completed Oct 30, 2023
@mtekman
Copy link

mtekman commented Oct 30, 2023

@dmpr0 -- fantastic that this is closed! Which PR implements this?

@dmpr0
Copy link
Contributor

dmpr0 commented Oct 30, 2023

@dmpr0 -- fantastic that this is closed! Which PR implements this?

Free Cloud backup is available, export into file is available too, any other option currently not planned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Nice to Have Should be fixed but there is no priority or no possibility to fix it within current horizon planning
Projects
None yet
Development

No branches or pull requests