BasicAirData / GPSLogger

A GPS logger for Android mobile devices
http://www.basicairdata.eu/projects/android/android-gps-logger/
GNU General Public License v3.0
371 stars 119 forks source link

Feature Request: Format in viewer list for Organic Maps => override to KML #187

Closed gvellut closed 1 year ago

gvellut commented 1 year ago

I use an app called Organic Maps for viewing OSM data: https://play.google.com/store/apps/details?id=app.organicmaps It is an opensource fork of Maps.me: https://github.com/organicmaps/organicmaps

I would like to check the recording by GPS Logger using that app. It only supports KML, which should be fine with GPS Logger, but for some reason the dialog when clicking on the eye icon in GPS Logger sets the format to GPX:

Screenshot_20220906-152030_GPS Logger_s2

(and, after clicking, the Organic Maps app opens but doesn't display anything, which is expected).

But it doesn't seem the GPX format is mentioned in the Organic Maps manifest: https://github.com/organicmaps/organicmaps/blob/master/android/AndroidManifest.xml . Only KML (multiple times actually).

As a workaround, would it be possible to force the use of KML for that app? Like what is done in https://github.com/BasicAirData/GPSLogger/blob/738f7e038a31cd6951dd6f42a60cf03799656fca/app/src/main/java/eu/basicairdata/graziano/gpslogger/ExternalViewerChecker.java#L193 for Maps.me? If the package name is the same as the app id, it should be : app.organicmaps

Thanks for your great software and for considering this request.

GrazianoCapelli commented 1 year ago

First of all thanks for your time and your useful reporting. I didn't know Organic Maps, so thank you also for informing me of its existence.

GPS Logger checks the presence of apps that can view the GPX and the KML files in order to present to the users a complete list on the View menu.

We perform the task using the standard Android method pm.queryIntentActivities with a mimetype application/gpx+xml but, for some strange reason I haven't found yet, MAPS.ME and Organic Maps are present into the list of apps that can handle this mimetype. I tried to exclude the KML mimetype from the research, but the problem is still present. Conversely Earth, that handles only KML files, is detected correctly. The same way Garmin Explore, that handles only GPX files, is detected correctly too.

As a workaround we can add the exception you rightly suggested, like we did for MAPS.ME. (In case you would like to pull the code, feel free to do it!) I can confirm that the package is app.organicmaps.

Anyway, if someone knows the reason of this bad behaviour, please suggest a definitive (and more elegant) solution for this issue.

gvellut commented 1 year ago

Thank you for your reply. I will send you a pull request soon.