App Links and Indexing
Bringing your app out from the dust on web
+Matteo Bonifazi
Senior Consultant @ Open Reply
Android Google Developer Expert
Member of GDG Rome
@mbonifazi
matteobonifazi[at]gmail[dot].com
1/3rd of themHow many apps do you actually use daily?
avg of 33 apps How many apps do you have installed in your phone?
*Google research in Us
Back in 1997
1 Milion of Web hostnames
1M Web hostnames
Today
1Bilion of Web hostnames - 1 Milion of apps in Google Play
1B+ Web Hostnames
1M+ apps in Play Store
Case studies - https://developers.google.com/app-indexing/case-studies
Acquire new users
Case studies - https://developers.google.com/app-indexing/case-studies
Re-engage existing users
Implementing App Indexing
Add deep link support
to appVerify
websitePublish app deep links
Done
Step 1 Step 2 Step 3
Add deep link support
to appVerify
websitePublish app deep links
Done
Step 1 Step 2 Step 3
<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 "http://example.com/gizmos” --> <data android:scheme="http" android:host="example.com" android:pathPrefix="/gizmos" /> </intent-filter></activity>
<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 "http://example.com/gizmos” --> <data android:scheme="http" android:host="example.com" android:pathPrefix="/gizmos" /> </intent-filter></activity>
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); setContentView(R.layout.main); Intent intent=getIntent(); String action=intent.getAction(); Uri data=intent.getData(); … Intent intentNext=new Intent(this, nextGizmosActivity.class); startActivity(intentNext);
}
How to test
adb shell am start -a android.intent.action.VIEW -d "http://example.com/gizmos" com.example.android
ADB
Deep link testing toolhttps://developers.google.com/app-indexing/android/test
Add deep link support
to appVerify
websitePublish app deep links
Done
Step 1 Step 2 Step 3
● Create URL format for App Indexing
● Add App Indexing Markup to your website
● Verify your website on Webmaster Tools
android-app://com.example/http/example.com/gizmos
URI format for app indexing
Protocol Package ID
PathScheme
<link rel=“alternate” href=“android-app://com.example/http/example.com/gizmos” />
App Indexing markup
Approve request on Webmaster Tools - https://www.google.com/webmasters/tools
<html><head> ... <link rel="alternate" href="android-app://com.example/http/example.com/gizmos" /> ...</head><body> … </body>
In the web page
Add deep link support
to appVerify
websitePublish app deep links
Done
Step 1 Step 2 Step 3
App Indexing API
Re-engage users through Google
Search App autocompletions
How to implement
compile 'com.google.android.gms:play-services-appindexing:8.3.0' build.gradle
Uri APP_URI = Uri.parse("android-app://com.example/http/example.com/gizmos");Uri WEB_URL = Uri.parse("http://www.example.com/index/"); URI definition
@Override protected void onCreate(Bundle savedInstanceState) { ... mClient = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build(); ... }
Google Client
App Indexing API - implementation @Override public void onStart() { super.onStart(); ... // Connect your client mClient.connect(); // Define a title for your current page, shown in autocompletion UI String title = "Example Title";
// Construct the Action performed by the user Action viewAction = Action.newAction(Action.TYPE_VIEW, title, WEB_URL, APP_URI);
// Call the App Indexing API start method after the view has completely rendered AppIndex.AppIndexApi.start(mClient, viewAction); ... }
App Indexing API - implementation
@Override public void onStop() { ... // Call end() and disconnect the client String title = "App Indexing API Title"; Action viewAction = Action.newAction(Action.TYPE_VIEW, title, WEB_URL, APP_URI); AppIndex.AppIndexApi.end(mClient, viewAction); mClient.disconnect(); ...
super.onStop(); }
Android● Dev Bytes - https://www.youtube.com/watch?v=aISUYHTkTOU
● Dev Bytes - https://www.youtube.com/watch?v=kYLrK-gD2Yg
● Codelab
○ 1.http://search-codelabs.appspot.com/codelabs/android-deep-linking
○ 2.http://search-codelabs.appspot.com/codelabs/app-indexing
○ 3.http://search-codelabs.appspot.com/codelabs/web-deep-linking
● Blog post - http://googledevelopers.blogspot.com/2014/12/four-steps-to-supercharge-deep-
linking.html
● FAQ - https://developers.google.com/app-indexing/faq
● StackOverflow - http://stackoverflow.com/questions/tagged/android-app-indexing
iOS - Just from iOS 9● Documentation - https://developers.google.com/app-indexing/ios/app
● Blog post - http://tinyurl.com/nmbrl4d
Thank you !
+Matteo Bonifazi - @mbonifazi
Senior Consultant @ Open Reply
Android GDE
matteobonifazi[at]gmail[dot].com