Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
The APP Ability takes you to a specific destination within an app or an RPK through a deep link, which is triggered upon a simple click.
Deep Linking is realized through a URI Scheme.
Launch the designated app, transfer data to it, and display details about specific content based on the transferred data.
Trigger the designated app and jump straight to a specific screen in the app with a URL link.
Connect apps together so that they are not isolated from each other.
Optimize user experience, which is the ultimate goal.
When a clicked link or programmatic request invokes a Web URI intent, the Android system tries each of the following actions, in sequential order, until the request succeeds:
Open the user’s preferred app that can handle the URI, if one is designated.
Open the only available app that can handle the URI.
Allow the user to select an app from a dialog.
Official introduction is available at: https://developer.android.com/training/app-links/deep-linking
- scheme://host/path:port/path?query1=xxxx&query2=xxxx
- For example:
- deeplinkapp://com.mytest.deeplink:8080/deeplinkDetail?param1=test
It comprises scheme, host, port, path, and query.
deeplinkapp: Indicates the Scheme name. (scheme)
com.mytest.deeplink: Indicates the address to which the Scheme applies. (host)
8080: Indicates the port number. (port)
deeplinkDetail: Indicates the page as specified by the Scheme. (path)
param1: Indicates the name of the transferred parameter. (query)
We need to add, in the manifest file, an intent filter to the activity to be opened to external parties. See the following for the configuration:
- <activity
- android:name=".******Activity">
- <intent-filter>
- <!--The following are mandatory-->
- <action android:name="android.intent.action.VIEW" />
- <category android:name="android.intent.category.DEFAULT" />
- <category android:name="android.intent.category.BROWSABLE" />
- <!--The URL Scheme, which may be configured as needed-->
- <data
- android:scheme="****" <!--For example android:scheme="deeplinkapp"-->
- android:host="****" <!--For example android:host="com.mytest.deeplink"-->
- android:port="****" <!--For example android:port="8080" -->
- android:path="****" <!--For example android:path="deeplinkDetail" -->
- />
- </intent-filter>
- </activity>
Add logic processing codes to the activity. Do as follows:
- if (getIntent() != null && getIntent().getData() != null)
- {
- Uri uri = getIntent().getData();
- if (uri != null) {
- //Complete URL information
- String url = uri.toString();
- //scheme
- String scheme = uri.getScheme();
- //host
- String host = uri.getHost();
- //port
- int port = uri.getPort();
- //path
- String path = uri.getPath();
- //query
- String query = uri.getQuery();
- //Obtain the value of the specified parameter
- String param1= uri.getQueryParameter("param1");
- }
- }
- $ adb shell am start -a android.intent.action.VIEW –d
- For example:
- adb shell am start -a android.intent.action.VIEW –d deeplinkapp://com.mytest.deeplink:8080/deeplinkDetail?
- param1=test com.mytest.deeplink
For details, see the Example.
- Replace the deeplink address in the deep link.html file, copy the file to your mobile phone, and open the HTML file from your web browser.
- <a href="deeplinkapp://com.mytest.deeplink:8080/deeplinkDetail?param1=test">Open APP</a>
1.Check with your product manager or the R&D that the app page supports deep link already.
Deep link format: [scheme]://[host]/[path]?[query]
2.Obtain the AndroidManifest file of the app and find the activity configuration for the corresponding page.
Example:
- <activity
- android:name="com.example.android.GizmosActivity"
- android:label="@string/title_gizmos" >
- <intent-filter android:label="@string/filter_view_http_gizmos">
- <action android:name="android.intent.action.VIEW" />
- <category android:name="android.intent.category.DEFAULT" />
- <category android:name="android.intent.category.BROWSABLE" />
- <!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
- <data android:scheme="http"
- android:host="www.example.com"
- android:pathPrefix="/gizmos" />
- <!-- note that the leading "/" is required for pathPrefix-->
- </intent-filter>
- <intent-filter android:label="@string/filter_view_example_gizmos">
- <action android:name="android.intent.action.VIEW" />
- <category android:name="android.intent.category.DEFAULT" />
- <category android:name="android.intent.category.BROWSABLE" />
- <!-- Accepts URIs that begin with "example://gizmos” -->
- <data android:scheme="example"
- android:host="testhost"
- android:pathPrefix="/gizmos" />
- </intent-filter>
- </activity>
3.Check <data> in the <intent-filter> element, where the scheme value and host value are the values of the scheme field and host field as defined in the deep link.
4.<path> and <data> support three attributes, namely, path, pathPattern, and pathPrefix. They are defined as follows:
path: It specifies a complete path, which will be processed by the app only when it is identical to the configured path.
pathPattern: It specifies the regular expression of a complete path. This means, the received path will be processed by the app only when it complies with the regular expression specified by pathPattern.
pathPrefix: It specifies the initial part of a path. The received path will be processed by the app as long as its prefix is the pathPrefdix value.
query indicates the parameters that are transferred to the page. It is a key-value pair. Different parameters are connected with an “&” symbol.
Example: name=zhangsan&age=26
A deep link that is obtained according to the preceding example is: example://testhost/gizmospath? Name=zhangsan&age=26.
For details, the File Structure of an RPK will be provided later.