This customization is for reference only!
First Open the Androidmanifest.xml
In Mainactivity, add the following:
<ActivityAndroid:name=". Mainactivity"> ... <Intent-filter> <ActionAndroid:name="Android.intent.action.VIEW"/> <Categoryandroid:name= "Android.intent.category.default"/> <category android:name=" Android.intent.category.browsable "/> <data android:scheme=" Com.example.androidtestintent-filter></ACTIVITY>
where the data tag Android:scheme is used to specify the protocol, something like HTTP, which we've designated as Com.example.androidtest,
This is a custom protocol that is specified to avoid conflicts with other applications.
We can also specify the domain name by android:host, Android:port to specify the port, Android:path to specify the path,
These properties can have more restrictions on deep links, and you need to meet certain criteria to open the specified app.
By the way, the meaning of Https://www.baidu.com/s?cl=3&wd=deeplink split corresponds to the following
Scheme://host:port/pathorpathprefixorPathpattern
HTTPS means that the encrypted protocol corresponds to the scheme in the Android data tag
Www.baidu.com indicates that the domain name corresponds to the host in the data tag
s indicates the port corresponds to the ports in the data tag
Cl=3&wd=deeplink indicates the path path corresponds to a path in the data tag
These properties are optional, but are also interdependent. If the scheme attribute is not specified for the intent filter, all other URI properties are ignored. If you do not specify a host property for the filter, the Port property and all path properties are ignored.
Android deep link with custom protocols!