You need to annotate deep links in the HTML markup of your web pages. You can do this in the section for each web page by adding a tag and specifying a deep link as an alternative URI.
See the Wikipedia example (I was looking for the source of the page you were looking for)
<meta name="generator" content="MediaWiki 1.24wmf15" /> <link rel="alternate" href="android-app://org.wikipedia/http/en.m.wikipedia.org/wiki/Apollo_17" /> <link rel="alternate" type="application/x-wiki" title="Edit this page" href="/w/index.php? title=Apollo_17&action=edit" />
You need to add the code below to the web pages:
<html> <head> <link rel="alternate" href="android-app://com.example.android/example/gizmos" /> ... </head> <body> ... </body>
Now, in order to process this intention in the application and when you are looking for something, and the link gives you the opportunity to open wikipedia in the application, if you want to support them, you need to change your Android application for this,
First you need to add the schema to your manifest.
Here's how the WikiPedia application works.
The WikiPedia app adds a diagram as shown below in its page browsing activity.
<activity android:name=".page.PageActivity" > <intent-filter> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="http" android:host="*.wikipedia.org" android:pathPrefix="/wiki/" /> <data android:scheme="https" android:host="*.wikipedia.org" android:pathPrefix="/wiki/" /> </intent-filter> </activity>
You need to do the same for your domain and this will work. If you need to make sure your application is also shown in deep links, refer to link1 and link2
AnkitSomani
source share