SlideShare a Scribd company logo
Android 
Deep Linking 
www.letsnurture.com
www.letsnurture.com
Find the right app for you 
www.letsnurture.com
www.letsnurture.com
Example 
Here's an intent that launches the Zxing barcode scanner app. It 
follows the syntax thus: 
intent: 
//scan/ 
#Intent; 
package=com.google.zxing.client.android; 
scheme=zxing; 
end; 
To launch the Zxing barcode scanner app, you encode your href on 
the anchor as follows: 
<a 
href="intent://scan/#Intent;scheme=zxing;package=com.google.zxi 
ng.client.android;end"> Take a QR code </a> www.letsnurture.com
What is App Indexing? 
App Indexing allows you to connect pages from 
your website with specific content within your 
smartphone app. 
This enables smartphone users who have your 
app installed to open it directly from relevant 
mobile search results on Google. 
For example, imagine you run a recipe website 
and have an app that can also show your recipe. 
Thanks to the app indexing feature, when a 
Google searcher on a mobile device is shown one 
of your recipes as a search result, they will now be 
able to open that result directly in your app if they 
have it installed. 
www.letsnurture.com
Here is how to specify a deep link to your app content: 
• In your Android manifest file, add one or 
more <intent-filter> elements for the activities that 
should be launchable from Google Search results. 
• Add an <action> tag that specifies 
the ACTION_VIEW intent action. 
• Add a <data> tag for each data URI format the 
activity accepts. This is the primary mechanism to 
declare the format for your deep links. 
www.letsnurture.com
• Add a <category> for 
both BROWSABLE and DEFAULT intent categories. 
– BROWSABLE is required in order for the intent to be executable from a 
web browser. Without it, clicking a link in a browser cannot resolve to 
your app and only the current web browser will respond to the URL. 
– DEFAULT is not required if your only interest is providing deep links to 
your app from Google Search results. However, the DEFAULT category 
is required if you want your Android app to respond when users click 
links from any other web page that points to your web site. The 
distinction is that the intent used from Google search results includes 
the identity of your app, so the intent explicitly points to your app as 
the recipient — other links to your site do not know your app identity, 
so the DEFAULT category declares your app can accept an implicit 
intent. 
www.letsnurture.com
<activity 
android:name="com.example.android.GizmosActivity" 
android:label="@string/title_gizmos" > <intent-filter 
android:label="@string/filter_title_viewgizmos"> <action 
android:name="android.intent.action.VIEW" /> <!-- 
Accepts URIs that begin with 
"http://example.com/gizmos” --> 
<data android:scheme="http" 
android:host="example.com" 
android:pathPrefix="/gizmos" /> <category 
android:name="android.intent.category.DEFAULT" /> 
<category 
android:name="android.intent.category.BROWSABLE" /> 
</intent-filter> 
</activity> 
www.letsnurture.com
In this example, your app would respond to 
deep links such as 
http://example.com/gizmos?1234, 
http://example.com/gizmos/1234, 
http://example.com/gizmos/toys/1234, etc. 
www.letsnurture.com
<activity android:name="com.example.android.GizmosActivity" 
android:label="@string/title_gizmos" > 
<intent-filter android:label="@string/filter_title_viewgizmos"> <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="gizmos" /> </intent-filter> 
<intent-filter android:label="@string/filter_title_viewgizmos"> 
<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://example.com/gizmos” --> <data 
android:scheme="http" android:host="example.com" 
android:pathPrefix="/gizmos" /> 
</intent-filter> 
</activity> 
www.letsnurture.com
• You can test your deep links using the Android Debug Bridge: 
adb shell am start -a android.intent.action.VIEW-d 
"http://example.com/gizmos" com.example.android 
adb shell am start -a android.intent.action.VIEW -d "example://gizmos" 
com.example.android 
Make sure to test this on a fresh install of your app as well. 
• Use our deep link test tool to test your app behavior with deep links 
on your phone. Alternatively, you can test your app's behavior in a 
browser by creating an HTML page with an intent:// link in it: 
<a 
href="intent://example.com/gizmos#Intent;scheme=http;package=com.exam 
ple.android;end;"> http://example.com/gizmos</a> <a 
href="intent://gizmos#Intent;scheme=example;package=com.example.androi 
d;end;">example://gizmos</a> 
www.letsnurture.com
Restricting access to parts of your app content 
res/xml/noindex.xml 
<?xml version="1.0" encoding="utf-8"?> 
<search-engine 
xmlns:android="http://schemas.android.com/ap 
k/res/android"> <noindex 
uri="http://example.com/gizmos/hidden_uri"/> 
<noindex 
uriPrefix="http://example.com/gizmos/hidden_p 
refix"/> <noindex uri="gizmos://hidden_path"/> 
<noindex uriPrefix="gizmos://hidden_prefix"/> 
</search-engine> 
www.letsnurture.com
<?xml version="1.0" encoding="utf-8"?> <manifest 
xmlns:android="http://schemas.android.com/apk/res/an 
droid" package="com.example.android.Gizmos"> 
<application> 
<activity 
android:name="com.example.android.GizmosActivity" 
android:label="@string/title_gizmos" > <intent-filter 
android:label="@string/filter_title_viewgizmos"> <action 
android:name="android.intent.action.VIEW"/> ... 
</activity> 
<meta-data android:name="search-engine" 
android:resource="@xml/noindex"/> 
</application> <uses-permission 
android:name="android.permission.INTERNET"/> 
</manifest> 
www.letsnurture.com
Connect your app to your website 
• In order for Google to recognize your app as the official 
application for your website, you must connect your app to 
your website through the Google Play Console and 
Webmaster Tools. Please follow the steps listed here. 
• After your app and your website are connected, if your app 
is using an HTTP scheme for handling deep links, Google 
will automatically start indexing the content of your app 
using URLs that Google has discovered through web 
indexing and that match the intent-filter patterns in 
yourAndroidManifest.xml file. 
• After your app content is indexed without errors, deep links 
can appear in Google mobile search results automatically. 
www.letsnurture.com
• If your app is using a custom URI scheme, 
you can still participate in App Indexing by 
specifying which deep links corresponds to 
your web pages using sitemaps, web 
annotations or the App Indexing API. 
• Regardless of whether your web content is 
indexed automatically or not, we still 
recommend that you publish your deep links 
using sitemaps, web annotations or the App 
Indexing API as we will discuss next. 
www.letsnurture.com
Add app deep links on your website 
• Each page on your site can specify whether its 
contents should be loaded in your app. We offer 
several ways to tell Google about the relationship 
between a web page and a deep link to your app: 
• Using a <link> element in the the <head> section of a 
page. 
• Using an <xhtml:link> element in the Sitemap <url> 
element specifying the page. 
• Using Schema.org markup for the ViewAction potential 
action. 
• Using the App Indexing API. 
• Using the App Indexing API can also surface your 
app's history in the Google app query 
autocompletions. 
www.letsnurture.com
Format of the app URIs 
• This <link> element specifies an alternate URI (specified in 
the href attribute) that can be used to open the content in your 
app. The format of the app URI is: 
• android-app://{package_id}/{scheme}/{host_path} 
Where: 
• package_id: application ID as specified in the Android Play 
Store. 
• scheme: the scheme to pass to the application. Can be http, 
or a custom scheme. 
• host_path: identifies the specific content within your 
application. 
www.letsnurture.com
Deep link App URI 
http://example.com/gizmos?1234 android-app:// 
com.example.android/http/example.com/ 
gizmos?1234 
http://example.com/gizmos/1234 android-app:// 
com.example.android/http/example.com/ 
gizmos/1234 
http://example.com/gizmos/toys/1234 android-app:// 
com.example.android/http/example.com/ 
gizmos/toys/1234 
example://gizmos?1234 android-app:// 
com.example.android/example/gizmos?1 
234 
example://gizmos/1234 android-app:// 
com.example.android/example/gizmos/1 
234 
example://gizmos/toys/1234 android-app:// 
com.example.android/example/gizmos/to 
ys/1234 
www.letsnurture.com
Link rel=alternate elements in HTML 
In the HTML of the page http://example.com/gizmos, you add a <link> 
element as follows for the deep link http://example.com/gizmos: 
<html> <head> ... <link rel="alternate" href="android-app:// 
com.example.android/http/example.com/gizmos" /> ... </head> <body> … 
</body> 
Or, if you're using a non-HTTP scheme (e.g., example://gizmo), you 
would add the following: 
<html> <head> ... <link rel="alternate" href="android-app:// 
com.example.android/example/gizmos" /> ... </head> <body> … </body> 
www.letsnurture.com
Update robots.txt 
• When Google indexes content from your app, your app will 
need to make any HTTP request that it usually makes under 
normal operation. 
• However, these requests will appear to your servers as 
originating from Googlebot. 
• Therefore, your server's robots.txt file must be configured 
properly to allow these requests. For example, your robots.txt 
file could include the following: 
User-Agent: Googlebot Allow: / 
• The app's behavior should not change because it or your 
server detects Googlebot. Consider network calls made from 
your app with Googlebot to be from a valid user. 
www.letsnurture.com
AndroidManifest.xml 
<application ... <meta-data 
android:name="com.google.android.gms.version" 
android:value="@integer/google_play_services_ver 
sion" /> ... </application> 
www.letsnurture.com
Once your project is configured to use Google Play Services API, follow these 
steps for any activity that supports deep links: 
• Create an instance of GoogleApiClient in the onCreate() method of your 
activity. 
• Notify Google each time a new activity is viewed using 
the AppIndexApi.view() method. This can be called in 
the onStart() method of each activity. 
• The view() should report the content that the user is currently looking at 
in your app. When that content changes, and the user is looking at 
something else, the app should call viewEnd() on the exiting content and 
then view() for the new content that is shown. 
• The usual way this works is with onStart() and onStop() but it need not in 
the case of fragments or other scrolling-type UIs, for example. 
• Disconnect your client in your onStop() method. 
www.letsnurture.com
Best Practices 
• Only call the AppIndexApi.view() method once 
each time the user explicitly chooses to view some 
content. 
• There should be an existing deep link in the app 
for each API call. 
• Use an accurate and descriptive title in 
your AppIndexApi.view() call. The text defined in 
this title may be used in the Google app query 
autocompletions. 
• We recommend that you inform your users that 
links visited in the app may be shared with Google 
to improve the search experience. 
www.letsnurture.com
Quality Guidelines 
• Google may take corrective action (e.g., demoting or removing your app 
deep links from Google Search results and query autocompletions) in 
cases where we see abuse, deception, or other actions that hurt the 
search experience for our users. In particular, you should avoid: 
• Calling the API on content the user is not viewing. 
• Calling the API more than once per user view. 
• Calling the API with a title that is misleading or incorrect. 
• Note that Google may react to other misleading practices not listed here. 
The examples above are not exhaustive. Google may take action on other 
practices or techniques that hurt the search experience. 
• Finally, once you have done everything in the launch checklist, Google will 
be able to start indexing your app. You can check for any issues that arise 
in Webmaster Tools. 
www.letsnurture.com
App Indexing Checklist 
Android app 
• App supports deep linking and the manifest file describes an intent 
filter with the action android.intent.action.VIEW, and has the 
categories android.intent.category.BROWSABLE and 
android.intent.category.DEFAULT. 
• App deep link implementation has been tested by running the 
command "adb shell am start [deep link]" or by using the deep link 
test tool on a fresh app install with an Android device. 
• Tapping the BACK button after opening a deep link leads you back 
to the previous screen. 
• After opening a deep link, relevant content is visible without further 
action required; app provides the "first click free" experience even 
on a freshly installed app. 
• App supports a deep link that opens the home screen. 
• App implements the App Indexing API to surface app's history in 
Google app query autocompletions. (Optional) 
www.letsnurture.com
Website and server 
• Deep link annotations have been added to 
sitemaps or to web pages. 
• None of the domains or subdomains the app 
needs resources from have robots.txt that 
blocks Googlebot from those resources. 
• Official website(s) for your app have been 
verified in your app's Play Console. 
www.letsnurture.com
Test your deep links 
• To test android-app:// URIs on your phone, 
enter a deep link URI in the text box below. It 
will generate a QR code that can be scanned 
using a barcode scanner app on your Android 
phone (e.g. Barcode Scanner), which should 
open a browser page with a link. When you 
click on the link on your phone, it should open 
the deep link you have entered in the text box. 
www.letsnurture.com
Featured Apps 
https://developers.google.com/app-indexing/apps 
www.letsnurture.com

More Related Content

ODP
Introduction to Version Control
PDF
Practical Federated Identity
PDF
Spring Boot & Actuators
PPTX
Introducing Swagger
PPTX
Version control system
PDF
github-actions.pdf
PDF
Painless JavaScript Testing with Jest
KEY
Upload files with grails
Introduction to Version Control
Practical Federated Identity
Spring Boot & Actuators
Introducing Swagger
Version control system
github-actions.pdf
Painless JavaScript Testing with Jest
Upload files with grails

What's hot (20)

PPTX
Git One Day Training Notes
PPTX
Angular
PPTX
Flask – Python
KEY
Introduction to Django
PPTX
Git and git workflow best practice
PDF
PPTX
Git Lab Introduction
PPTX
Git - Basic Crash Course
PDF
codecept.js introduce - front end test E2E tool introduce
PDF
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
PDF
Git 101: Git and GitHub for Beginners
PDF
Building .NET Microservices
PPTX
Android studio installation
PPTX
Maven
PPTX
React native development with expo
PPTX
Angular Data Binding
PPTX
Git and GitFlow branching model
KEY
Introduction to Git
Git One Day Training Notes
Angular
Flask – Python
Introduction to Django
Git and git workflow best practice
Git Lab Introduction
Git - Basic Crash Course
codecept.js introduce - front end test E2E tool introduce
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Git 101: Git and GitHub for Beginners
Building .NET Microservices
Android studio installation
Maven
React native development with expo
Angular Data Binding
Git and GitFlow branching model
Introduction to Git
Ad

Viewers also liked (20)

PDF
App Indexing: Blurring the Lines Between Your Website and App
PPTX
Mobile Deep linking
PDF
Mobile Deep Linking for Apps – What? Why? How?
PPTX
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
PPTX
Branch presentation v1.0.1
PDF
M Kozlova Portfolio Samples Ln
PPTX
android deep linking
PPTX
How Deep Linking Can Tackle The Challenges Of Mobile Fragmentation
 
PDF
An Introduction to Deep Linking and App Indexing Codelab
PDF
Increasing App Installs With App Indexation By Justin Briggs
PPTX
How to win in app store optimization
PPTX
The Future of Deep Linking & App Indexing
PDF
10 Killer App Store Marketing Tips
PPTX
Everything an SEO Needs to Know About Google Now
PPTX
Criteo State of Mobile Commerce Q4 2015
PDF
Deep linking - a fundamental change in the mobile app ecosystem
PDF
Marshall Cassidy : VOCALSpin : The Love Letter
PPTX
Part of the sentences. Basic Grammar
PPSX
ชายตาบอดกับสุนัขนำทาง
PPT
Webquest
App Indexing: Blurring the Lines Between Your Website and App
Mobile Deep linking
Mobile Deep Linking for Apps – What? Why? How?
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
Branch presentation v1.0.1
M Kozlova Portfolio Samples Ln
android deep linking
How Deep Linking Can Tackle The Challenges Of Mobile Fragmentation
 
An Introduction to Deep Linking and App Indexing Codelab
Increasing App Installs With App Indexation By Justin Briggs
How to win in app store optimization
The Future of Deep Linking & App Indexing
10 Killer App Store Marketing Tips
Everything an SEO Needs to Know About Google Now
Criteo State of Mobile Commerce Q4 2015
Deep linking - a fundamental change in the mobile app ecosystem
Marshall Cassidy : VOCALSpin : The Love Letter
Part of the sentences. Basic Grammar
ชายตาบอดกับสุนัขนำทาง
Webquest
Ad

Similar to Android Deep Linking (20)

PPTX
App Deep Linking
PPTX
Deep linking slides
PDF
iOS & Android App Indexing & App Actions
PDF
Deep linking
PDF
How to Setup App Indexation
PPTX
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
PDF
[@NaukriEngineering] Deferred deep linking in iOS
PPTX
Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015
PPTX
Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015
PPTX
Preparing for the Mobile Algorithm Shift
PPTX
Android Marshmallow APIs and Changes
PPTX
What You Need to Know About Google App Indexing - SMX West 2016
PPTX
Google & Bing App Indexing - SMX Munich 2016
PDF
UaMobitech - App Links and App Indexing API
PPTX
How App Indexation Works
PDF
Deep Link (to the Future)
PPTX
Firebase App-Indexing - SMX London 2016
PPTX
Emily Grossman App Indexing SMX West 2017
PDF
How NOT to Suck at App Distribution - Quick Start Guide - Appsocially's Growt...
PDF
The Death of the Desktop: The Future For Mobile SEO
App Deep Linking
Deep linking slides
iOS & Android App Indexing & App Actions
Deep linking
How to Setup App Indexation
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
[@NaukriEngineering] Deferred deep linking in iOS
Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015
Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015
Preparing for the Mobile Algorithm Shift
Android Marshmallow APIs and Changes
What You Need to Know About Google App Indexing - SMX West 2016
Google & Bing App Indexing - SMX Munich 2016
UaMobitech - App Links and App Indexing API
How App Indexation Works
Deep Link (to the Future)
Firebase App-Indexing - SMX London 2016
Emily Grossman App Indexing SMX West 2017
How NOT to Suck at App Distribution - Quick Start Guide - Appsocially's Growt...
The Death of the Desktop: The Future For Mobile SEO

More from Ketan Raval (20)

PPTX
Amazon Alexa Auto Software Development Kit (SDK)
PPTX
Proximity Marketing Solutions enhancing Businesses leveraging iBeacon SDK Int...
PPTX
Keynote 2016
PPTX
Zero ui future is here
PPTX
Android n and beyond
PPTX
IoT and Future of Connected world
PPTX
#Instagram API Get visibility you always wanted
PPTX
Keynote - Devfest 2015 organized by GDG Ahmedabad
PPTX
Android notifications
PPT
How to make your Mobile App HIPPA Compliant
PPT
3 d touch a true game changer
PPT
OBD Mobile App - Fault Codes, Driving Behaviour and Fuel Economy
PPT
Vehicle to vehicle communication using gps
PPT
Obd how to guide
PPT
Garmin api integration
PPT
Beacon The Google Way
PPT
Edge detection iOS application
PPT
Google calendar integration in iOS app
PPTX
Big data cloudcomputing
PPT
All about Apple Watchkit
Amazon Alexa Auto Software Development Kit (SDK)
Proximity Marketing Solutions enhancing Businesses leveraging iBeacon SDK Int...
Keynote 2016
Zero ui future is here
Android n and beyond
IoT and Future of Connected world
#Instagram API Get visibility you always wanted
Keynote - Devfest 2015 organized by GDG Ahmedabad
Android notifications
How to make your Mobile App HIPPA Compliant
3 d touch a true game changer
OBD Mobile App - Fault Codes, Driving Behaviour and Fuel Economy
Vehicle to vehicle communication using gps
Obd how to guide
Garmin api integration
Beacon The Google Way
Edge detection iOS application
Google calendar integration in iOS app
Big data cloudcomputing
All about Apple Watchkit

Recently uploaded (20)

PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
cuic standard and advanced reporting.pdf
PPTX
Cloud computing and distributed systems.
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Spectroscopy.pptx food analysis technology
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Big Data Technologies - Introduction.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
KodekX | Application Modernization Development
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
cuic standard and advanced reporting.pdf
Cloud computing and distributed systems.
Network Security Unit 5.pdf for BCA BBA.
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Spectroscopy.pptx food analysis technology
NewMind AI Weekly Chronicles - August'25 Week I
Spectral efficient network and resource selection model in 5G networks
Big Data Technologies - Introduction.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
KodekX | Application Modernization Development
sap open course for s4hana steps from ECC to s4
MYSQL Presentation for SQL database connectivity
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

Android Deep Linking

  • 1. Android Deep Linking www.letsnurture.com
  • 3. Find the right app for you www.letsnurture.com
  • 5. Example Here's an intent that launches the Zxing barcode scanner app. It follows the syntax thus: intent: //scan/ #Intent; package=com.google.zxing.client.android; scheme=zxing; end; To launch the Zxing barcode scanner app, you encode your href on the anchor as follows: <a href="intent://scan/#Intent;scheme=zxing;package=com.google.zxi ng.client.android;end"> Take a QR code </a> www.letsnurture.com
  • 6. What is App Indexing? App Indexing allows you to connect pages from your website with specific content within your smartphone app. This enables smartphone users who have your app installed to open it directly from relevant mobile search results on Google. For example, imagine you run a recipe website and have an app that can also show your recipe. Thanks to the app indexing feature, when a Google searcher on a mobile device is shown one of your recipes as a search result, they will now be able to open that result directly in your app if they have it installed. www.letsnurture.com
  • 7. Here is how to specify a deep link to your app content: • In your Android manifest file, add one or more <intent-filter> elements for the activities that should be launchable from Google Search results. • Add an <action> tag that specifies the ACTION_VIEW intent action. • Add a <data> tag for each data URI format the activity accepts. This is the primary mechanism to declare the format for your deep links. www.letsnurture.com
  • 8. • Add a <category> for both BROWSABLE and DEFAULT intent categories. – BROWSABLE is required in order for the intent to be executable from a web browser. Without it, clicking a link in a browser cannot resolve to your app and only the current web browser will respond to the URL. – DEFAULT is not required if your only interest is providing deep links to your app from Google Search results. However, the DEFAULT category is required if you want your Android app to respond when users click links from any other web page that points to your web site. The distinction is that the intent used from Google search results includes the identity of your app, so the intent explicitly points to your app as the recipient — other links to your site do not know your app identity, so the DEFAULT category declares your app can accept an implicit intent. www.letsnurture.com
  • 9. <activity android:name="com.example.android.GizmosActivity" android:label="@string/title_gizmos" > <intent-filter android:label="@string/filter_title_viewgizmos"> <action android:name="android.intent.action.VIEW" /> <!-- Accepts URIs that begin with "http://example.com/gizmos” --> <data android:scheme="http" android:host="example.com" android:pathPrefix="/gizmos" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> </intent-filter> </activity> www.letsnurture.com
  • 10. In this example, your app would respond to deep links such as http://example.com/gizmos?1234, http://example.com/gizmos/1234, http://example.com/gizmos/toys/1234, etc. www.letsnurture.com
  • 11. <activity android:name="com.example.android.GizmosActivity" android:label="@string/title_gizmos" > <intent-filter android:label="@string/filter_title_viewgizmos"> <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="gizmos" /> </intent-filter> <intent-filter android:label="@string/filter_title_viewgizmos"> <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://example.com/gizmos” --> <data android:scheme="http" android:host="example.com" android:pathPrefix="/gizmos" /> </intent-filter> </activity> www.letsnurture.com
  • 12. • You can test your deep links using the Android Debug Bridge: adb shell am start -a android.intent.action.VIEW-d "http://example.com/gizmos" com.example.android adb shell am start -a android.intent.action.VIEW -d "example://gizmos" com.example.android Make sure to test this on a fresh install of your app as well. • Use our deep link test tool to test your app behavior with deep links on your phone. Alternatively, you can test your app's behavior in a browser by creating an HTML page with an intent:// link in it: <a href="intent://example.com/gizmos#Intent;scheme=http;package=com.exam ple.android;end;"> http://example.com/gizmos</a> <a href="intent://gizmos#Intent;scheme=example;package=com.example.androi d;end;">example://gizmos</a> www.letsnurture.com
  • 13. Restricting access to parts of your app content res/xml/noindex.xml <?xml version="1.0" encoding="utf-8"?> <search-engine xmlns:android="http://schemas.android.com/ap k/res/android"> <noindex uri="http://example.com/gizmos/hidden_uri"/> <noindex uriPrefix="http://example.com/gizmos/hidden_p refix"/> <noindex uri="gizmos://hidden_path"/> <noindex uriPrefix="gizmos://hidden_prefix"/> </search-engine> www.letsnurture.com
  • 14. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/an droid" package="com.example.android.Gizmos"> <application> <activity android:name="com.example.android.GizmosActivity" android:label="@string/title_gizmos" > <intent-filter android:label="@string/filter_title_viewgizmos"> <action android:name="android.intent.action.VIEW"/> ... </activity> <meta-data android:name="search-engine" android:resource="@xml/noindex"/> </application> <uses-permission android:name="android.permission.INTERNET"/> </manifest> www.letsnurture.com
  • 15. Connect your app to your website • In order for Google to recognize your app as the official application for your website, you must connect your app to your website through the Google Play Console and Webmaster Tools. Please follow the steps listed here. • After your app and your website are connected, if your app is using an HTTP scheme for handling deep links, Google will automatically start indexing the content of your app using URLs that Google has discovered through web indexing and that match the intent-filter patterns in yourAndroidManifest.xml file. • After your app content is indexed without errors, deep links can appear in Google mobile search results automatically. www.letsnurture.com
  • 16. • If your app is using a custom URI scheme, you can still participate in App Indexing by specifying which deep links corresponds to your web pages using sitemaps, web annotations or the App Indexing API. • Regardless of whether your web content is indexed automatically or not, we still recommend that you publish your deep links using sitemaps, web annotations or the App Indexing API as we will discuss next. www.letsnurture.com
  • 17. Add app deep links on your website • Each page on your site can specify whether its contents should be loaded in your app. We offer several ways to tell Google about the relationship between a web page and a deep link to your app: • Using a <link> element in the the <head> section of a page. • Using an <xhtml:link> element in the Sitemap <url> element specifying the page. • Using Schema.org markup for the ViewAction potential action. • Using the App Indexing API. • Using the App Indexing API can also surface your app's history in the Google app query autocompletions. www.letsnurture.com
  • 18. Format of the app URIs • This <link> element specifies an alternate URI (specified in the href attribute) that can be used to open the content in your app. The format of the app URI is: • android-app://{package_id}/{scheme}/{host_path} Where: • package_id: application ID as specified in the Android Play Store. • scheme: the scheme to pass to the application. Can be http, or a custom scheme. • host_path: identifies the specific content within your application. www.letsnurture.com
  • 19. Deep link App URI http://example.com/gizmos?1234 android-app:// com.example.android/http/example.com/ gizmos?1234 http://example.com/gizmos/1234 android-app:// com.example.android/http/example.com/ gizmos/1234 http://example.com/gizmos/toys/1234 android-app:// com.example.android/http/example.com/ gizmos/toys/1234 example://gizmos?1234 android-app:// com.example.android/example/gizmos?1 234 example://gizmos/1234 android-app:// com.example.android/example/gizmos/1 234 example://gizmos/toys/1234 android-app:// com.example.android/example/gizmos/to ys/1234 www.letsnurture.com
  • 20. Link rel=alternate elements in HTML In the HTML of the page http://example.com/gizmos, you add a <link> element as follows for the deep link http://example.com/gizmos: <html> <head> ... <link rel="alternate" href="android-app:// com.example.android/http/example.com/gizmos" /> ... </head> <body> … </body> Or, if you're using a non-HTTP scheme (e.g., example://gizmo), you would add the following: <html> <head> ... <link rel="alternate" href="android-app:// com.example.android/example/gizmos" /> ... </head> <body> … </body> www.letsnurture.com
  • 21. Update robots.txt • When Google indexes content from your app, your app will need to make any HTTP request that it usually makes under normal operation. • However, these requests will appear to your servers as originating from Googlebot. • Therefore, your server's robots.txt file must be configured properly to allow these requests. For example, your robots.txt file could include the following: User-Agent: Googlebot Allow: / • The app's behavior should not change because it or your server detects Googlebot. Consider network calls made from your app with Googlebot to be from a valid user. www.letsnurture.com
  • 22. AndroidManifest.xml <application ... <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_ver sion" /> ... </application> www.letsnurture.com
  • 23. Once your project is configured to use Google Play Services API, follow these steps for any activity that supports deep links: • Create an instance of GoogleApiClient in the onCreate() method of your activity. • Notify Google each time a new activity is viewed using the AppIndexApi.view() method. This can be called in the onStart() method of each activity. • The view() should report the content that the user is currently looking at in your app. When that content changes, and the user is looking at something else, the app should call viewEnd() on the exiting content and then view() for the new content that is shown. • The usual way this works is with onStart() and onStop() but it need not in the case of fragments or other scrolling-type UIs, for example. • Disconnect your client in your onStop() method. www.letsnurture.com
  • 24. Best Practices • Only call the AppIndexApi.view() method once each time the user explicitly chooses to view some content. • There should be an existing deep link in the app for each API call. • Use an accurate and descriptive title in your AppIndexApi.view() call. The text defined in this title may be used in the Google app query autocompletions. • We recommend that you inform your users that links visited in the app may be shared with Google to improve the search experience. www.letsnurture.com
  • 25. Quality Guidelines • Google may take corrective action (e.g., demoting or removing your app deep links from Google Search results and query autocompletions) in cases where we see abuse, deception, or other actions that hurt the search experience for our users. In particular, you should avoid: • Calling the API on content the user is not viewing. • Calling the API more than once per user view. • Calling the API with a title that is misleading or incorrect. • Note that Google may react to other misleading practices not listed here. The examples above are not exhaustive. Google may take action on other practices or techniques that hurt the search experience. • Finally, once you have done everything in the launch checklist, Google will be able to start indexing your app. You can check for any issues that arise in Webmaster Tools. www.letsnurture.com
  • 26. App Indexing Checklist Android app • App supports deep linking and the manifest file describes an intent filter with the action android.intent.action.VIEW, and has the categories android.intent.category.BROWSABLE and android.intent.category.DEFAULT. • App deep link implementation has been tested by running the command "adb shell am start [deep link]" or by using the deep link test tool on a fresh app install with an Android device. • Tapping the BACK button after opening a deep link leads you back to the previous screen. • After opening a deep link, relevant content is visible without further action required; app provides the "first click free" experience even on a freshly installed app. • App supports a deep link that opens the home screen. • App implements the App Indexing API to surface app's history in Google app query autocompletions. (Optional) www.letsnurture.com
  • 27. Website and server • Deep link annotations have been added to sitemaps or to web pages. • None of the domains or subdomains the app needs resources from have robots.txt that blocks Googlebot from those resources. • Official website(s) for your app have been verified in your app's Play Console. www.letsnurture.com
  • 28. Test your deep links • To test android-app:// URIs on your phone, enter a deep link URI in the text box below. It will generate a QR code that can be scanned using a barcode scanner app on your Android phone (e.g. Barcode Scanner), which should open a browser page with a link. When you click on the link on your phone, it should open the deep link you have entered in the text box. www.letsnurture.com