UaMobitech - App Links and App Indexing API

26
App Links and Indexing Bringing your app out from the dust on web

Transcript of UaMobitech - App Links and App Indexing API

Page 1: UaMobitech - App Links and App Indexing API

App Links and Indexing

Bringing your app out from the dust on web

Page 2: UaMobitech - App Links and App Indexing API

+Matteo Bonifazi

Senior Consultant @ Open Reply

Android Google Developer Expert

Member of GDG Rome

@mbonifazi

matteobonifazi[at]gmail[dot].com

Page 3: UaMobitech - App Links and App Indexing API

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

Page 4: UaMobitech - App Links and App Indexing API

Back in 1997

1 Milion of Web hostnames

1M Web hostnames

Page 5: UaMobitech - App Links and App Indexing API

Today

1Bilion of Web hostnames - 1 Milion of apps in Google Play

1B+ Web Hostnames

1M+ apps in Play Store

Page 6: UaMobitech - App Links and App Indexing API
Page 7: UaMobitech - App Links and App Indexing API

Case studies - https://developers.google.com/app-indexing/case-studies

Acquire new users

Page 8: UaMobitech - App Links and App Indexing API

Case studies - https://developers.google.com/app-indexing/case-studies

Re-engage existing users

Page 9: UaMobitech - App Links and App Indexing API

Implementing App Indexing

Page 10: UaMobitech - App Links and App Indexing API

Add deep link support

to appVerify

websitePublish app deep links

Done

Step 1 Step 2 Step 3

Page 11: UaMobitech - App Links and App Indexing API

Add deep link support

to appVerify

websitePublish app deep links

Done

Step 1 Step 2 Step 3

Page 12: UaMobitech - App Links and App Indexing API

<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>

Page 13: UaMobitech - App Links and App Indexing API

<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>

Page 14: UaMobitech - App Links and App Indexing API

@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);

}

Page 15: UaMobitech - App Links and App Indexing API

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

Page 16: UaMobitech - App Links and App Indexing API

Add deep link support

to appVerify

websitePublish app deep links

Done

Step 1 Step 2 Step 3

Page 17: UaMobitech - App Links and App Indexing API

● Create URL format for App Indexing

● Add App Indexing Markup to your website

● Verify your website on Webmaster Tools

Page 18: UaMobitech - App Links and App Indexing API

android-app://com.example/http/example.com/gizmos

URI format for app indexing

Protocol Package ID

PathScheme

Page 19: UaMobitech - App Links and App Indexing API

<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

Page 20: UaMobitech - App Links and App Indexing API

Add deep link support

to appVerify

websitePublish app deep links

Done

Step 1 Step 2 Step 3

Page 21: UaMobitech - App Links and App Indexing API

App Indexing API

Re-engage users through Google

Search App autocompletions

Page 22: UaMobitech - App Links and App Indexing API

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

Page 23: UaMobitech - App Links and App Indexing API

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); ... }

Page 24: UaMobitech - App Links and App Indexing API

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(); }

Page 25: UaMobitech - App Links and App Indexing API

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

Page 26: UaMobitech - App Links and App Indexing API

Thank you !

+Matteo Bonifazi - @mbonifazi

Senior Consultant @ Open Reply

Android GDE

matteobonifazi[at]gmail[dot].com