Android Deeplink function implementation

To realize the DeepLink function, the following points are needed:
1. Set in the Activity to realize the Deeplink;

-<intent-filter>

<action android:name="android.intent.action.VIEW"/>

<category android:name="android.intent.category.DEFAULT"/>

<category android:name="android.intent.category.BROWSABLE"/>

<data android:scheme="haoan" android:path="/main" android:host="com.haoan"/>

</intent-filter>

The scheme, host and path in the data are the part of the Uri corresponding to the activity.
2. Add the following tags in the corresponding HTML document:

<a href="haoan://com.haoan/main>启动</a>

In this way, the Activity can be opened directly by clicking the hyperlink in the HTML document in the google browser.
Android Uri format:

[scheme://][host]<:port><path><?query1&query2&...><#fragment>

The content in [] is required, and <> is not required.

Guess you like

Origin blog.csdn.net/skateboard1/article/details/45273177