Android Handling Deep Links

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

Deep links are URLs that take users directly to specific content in your app. You can set up deep links by adding intent filters and extracting data from incoming intents to drive users to the right screen in your app.

Parameters

<data> AttributeDetails
schemeThe scheme part of a URI (case-sensitive). Examples: http, https, ftp
hostThe host part of a URI (case-sensitive). Examples: google.com, example.org
portThe port part of a URI. Examples: 80, 443
pathThe path part of a URI. Must begin with /. Examples: /, /about
pathPrefixA prefix for the path part of a URI. Examples: /item, /article
pathPatternA pattern to match for the path part of a URI. Examples: /item/.*, /article/[0-9]*
mimeTypeA mime type to match. Examples: image/jpeg, audio/*

Remarks

The <intent-filter>

This combination of <action> and <category> elements is what tells the Android system that a specific Activity should be launched when the user clicks on a link in another application.

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />

    <data ... />

</intent-filter>

Multiple <data> tags

The set of deep links that your <intent-filter> supports is the cross-product of all the <data> elements that you define in that intent-filter. The multiple domain, multiple path, and multiple scheme examples demonstrate this.

Resources



Got any Android Question?