Pygmalion69 / OpenTopoMapViewer

OpenTopoMap viewer for Android
Apache License 2.0
44 stars 11 forks source link

The app doesn't appear on the list of viewers in BasicAirData GPS Logger #17

Closed GrazianoCapelli closed 3 years ago

GrazianoCapelli commented 3 years ago

Dear team, I'm one of the developers of a free and opensource Android app called BasicAirData GPS Logger. Here you can find the source code: https://github.com/BasicAirData/GPSLogger It is a lightweight offline track recorder that, for the visualization of the tracks, uses all the apps installed on the device that are capable to view GPX/KML files.

The app scans all the capable apps (in https://github.com/BasicAirData/GPSLogger/blob/master/app/src/main/java/eu/basicairdata/graziano/gpslogger/ExternalViewerChecker.java) this way:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
final PackageManager pm = context.getPackageManager();
File file = new File(getApplicationContext().getFilesDir() + "/empty.gpx");
Uri uri = FileProvider.getUriForFile(GPSApplication.getInstance(), "eu.basicairdata.graziano.gpslogger.fileprovider", file);
intent.setDataAndType(uri, "application/gpx+xml");
List<ResolveInfo> kmlLRI = pm.queryIntentActivities(intent, 0);

The kmlLRI list contains all the apps that are capable to open the GPX files. All except OpenTopoMap Viewer.

I'm aware of the existance of your great app thanks to a user's feedback that reported the issue (https://github.com/BasicAirData/GPSLogger/issues/142). I looked into your Manifest, and I found a strange implementation of the <intent-filter>. What could we add to the GPS Logger's intent in order to find also your app?

Both GPS Logger and OpenTopoMap Viewer are free and open source (we are on Play Store and on F-Droid on IzzyOnDroid F-Droid Repository): it would be great to add the compatibility.

Pygmalion69 commented 3 years ago

Thank you for reporting this. I've added the MIME type for "application/gpx+xml". https://youtu.be/kBdBjx_3auo

GrazianoCapelli commented 3 years ago

Thanks for adding the standard application/gpx+xml MIME type to OpenTopoMap Viewer's intent-filter. This way GPS Logger will work well without any code modification. I await the updated v1.11.6 APK to test the feature and close the issue.

GrazianoCapelli commented 3 years ago

Version 1.11.6 (27) tested, it works like a charm with GPS Logger. Thanks again!