OpenOrienteering / mapper

OpenOrienteering Mapper is a software for creating maps for the orienteering sport.
https://www.openorienteering.org/apps/mapper/
GNU General Public License v3.0
397 stars 106 forks source link

Android: Mapper not listed when opening .omap file #802

Open bagage opened 7 years ago

bagage commented 7 years ago

Steps to reproduce

  1. Download some .omap file
  2. Open it via the File Explorer

Actual behaviour

The file is getting opened in OsmAnd.

Expected behaviour

Android should ask if I'd like to open it with Mapper or OsmAnd. I'm getting that in the logs:

When opening via Cyanogen file explorer:

11-24 15:13:58.850 1174 1888 I ActivityManager: START u0 {act=android.intent.action.VIEW dat=content://com.cyanogenmod.filemanager.providers.file/external_files/mymap.omap typ=application/octet-stream flg=0x1 cmp=net.osmand.plus/.activities.MapActivity} from uid 10046 on display 0 11-24 15:13:58.924 1174 2224 I ActivityManager: Start proc 21940:net.osmand.plus/u0a84 for activity net.osmand.plus/.activities.MapActivity

When opening directly within K9 mail client:

11-24 15:26:18.261 1174 1888 I ActivityManager: START u0 {act=android.intent.action.VIEW dat=content://com.fsck.k9.attachmentprovider/b505ddcf-b142-4aab-a4e1-2f0bd72c7e43/123/VIEW typ=application/xml flg=0x80001 cmp=com.cyanogenmod.filemanager/.activities.EditorActivity} from uid 10089 on display 0

Configuration

Mapper Version: 0.6.6 Operating System: Android 7.0

dg0yt commented 7 years ago

I can reproduce that Mapper is not offered for opening files on Android 6.0. But it works as expected on Android 4.4.2. We implemented what was neccessary two years ago, but now it seems to be broken for newer version of Android.

bagage commented 7 years ago

As it's working on OsmAnd, it might be worth looking at their AndroidManifest.xml for instance.

dg0yt commented 7 years ago

The examples you gave show URLs (dat=...) using the content scheme. At the moment, Mapper supports the file scheme only, and that's why it registers for this scheme only.

In order to support the content scheme (which plays a major role on Android), we need to: