Add one or more <data>
tags, each of which represents a URI format that resolves to the activity. At minimum, the
<data> tag must include
the android:scheme
attribute.

You can add more attributes to further refine the type of URI that the activity accepts. For
example, you might have multiple activities that accept similar URIs, but which differ simply
based on the path name. In this case, use the
android:path attribute
or its pathPattern or pathPrefix variants to differentiate which
activity the system should open for different URI paths.

Notice that the two intent filters only differ by the <data> element.
Although it's possible to include multiple <data> elements in the same filter,
it's important that you create separate filters when your intention is to declare unique
URLs (such as a specific combination of scheme and host), because
multiple <data> elements in the same intent filter are actually merged together
to account for all variations of their combined attributes. For example, consider the following:

Read data from incoming intents

Once the system starts your activity through an intent filter, you can
use data provided by the Intent to determine what you need to render. Call
the getData() and
getAction() methods to retrieve the data and
action associated with the incoming Intent. You can
call these methods at any time during the lifecycle of the activity, but you
should generally do so during early callbacks such as
onCreate() or
onStart().

The deep link should take users directly to the content,
without any prompts, interstitial pages, or logins. Make sure that users can
see the app content even if they never previously opened the application.
It is okay to prompt users on subsequent interactions or when they open the app
from the Launcher. This is the same principle as the first click free experience for web sites.

Follow the design guidance described in
Navigation with Back and Up
so that your app matches users' expectations for backward navigation after
they enter your app through a deep link.

Test your deep links

You can use the Android Debug
Bridge with the activity manager (am) tool to test that the intent filter
URIs you specified for deep linking resolve to the correct app activity. You
can run the adb command against a device or an emulator.

The manifest declaration and intent handler you set above define the connection between your app
and a website and what to do with incoming links. However, in
order to have the system treat your app as the default handler for a set of URIs, you must
also request that the system verify this connection.
The next lesson explains how to
implement this verification.

To learn more about intents and app links, see the following resources: