Thanks Flavio, that's really useful. I'd totally forgotten about Dianne Hackborn
reminding devs (6 years ago) not to use custom schemes!
I've tested out both the intent: and android-app: schemes and they work-ish (but I don't think as intended).
AnkiDroid (I'm using the version on Play Store) kicks off an "android.intent.action.VIEW" intent with the "intent:" or "android-app:" uri as the data. I was expecting AnkiDroid to resolve it using Intent.parseUri() and then start an activity using that.
So, to get this working, I needed to add the following to my intent-filter (this feels wrong):
<action android:name="android.intent.action.VIEW" />
<data android:scheme="intent"/> or <data android:scheme="android-app" android:host="com.mycompany.myapp"/>The "intent:" one is particularly bad because that would catch all "intent:" uris. The fact that no other apps on my device support this "intent:" uri (no Intent chooser comes up) suggests that AnkiDroid is not handing the intent uri properly. The "android-app:" scheme is handled by the Google App which presumably is responsible for choosing whether forward the uri to the app or Play Store app. Curiously if I let Google App handle the uri then the Play Store opens but with a blank screen.
Any pointers as to which part of the AnkiDroid code handles such intents, so I can take a look?