diff --git a/docs/html/images/tools/ai-appindexingtest.png b/docs/html/images/tools/ai-appindexingtest.png new file mode 100644 index 0000000000000..385bc21f12cc8 Binary files /dev/null and b/docs/html/images/tools/ai-appindexingtest.png differ diff --git a/docs/html/tools/help/app-link-indexing.jd b/docs/html/tools/help/app-link-indexing.jd index 611373a28ab5e..5b76059a52c18 100644 --- a/docs/html/tools/help/app-link-indexing.jd +++ b/docs/html/tools/help/app-link-indexing.jd @@ -1,4 +1,4 @@ -page.title=Deep Link and App Indexing API Support in Android Studio +page.title=Supporting URLs and App Indexing in Android Studio parent.title=Tools parent.link=index.html page.tags=app indexing @@ -9,11 +9,13 @@ page.tags=app indexing
Android Studio helps you add deep links, app indexing, and search functionality to your apps. +
Android Studio helps you add support for URLs, app indexing, and search +functionality to your apps. These features can help to drive more traffic to your app, discover which app content is used most, make it easier for users to find content in an installed app, and attract new users.
To use Android Studio to add deep link, app indexing, and search features to your app, follow - these basic steps:
+To use Android Studio to add support for URL, app indexing, and search +features to your app:
Intent filters and the App Indexing API are ways to implement deep links and app indexing, but +
Intent filters and the App Indexing API are ways to implement URL support +and app indexing, but there are other possible implementations as well. See Alternate Android Indexing Methods for more information.
-Android Studio can create a basic intent filter in your manifest that you can customize to - define deep link URLs for your app. You can then write Java code in an activity to handle the + define URLs for your app. You can then write Java code in an activity to handle the intent. This implementation lets users directly open the specified app activity by - clicking a deep link. Users can see the deep links in google.com in a browser, in the + clicking a URL. Users can see the URLs in google.com in a browser, in the Google Search app, and in Google Now on Tap.
-After setting up deep links for your app, you can associate your website with your app by using +
After setting up URL support for your app, you can associate your website +with your app by using the Google Search Console and Google Play Developer Console. Afterward, Google indexes your app for URLs defined in your intent filters and begins to include them in search results. In addition, you can optionally @@ -91,11 +96,11 @@ page.tags=app indexing
As an alternative to associating your app with a website, for Android 6.0 (API level 23) and higher, you can add default handlers and verification for deep links + >default handlers and verification for URLs instead.
-Chrome displaying google.com serves search results with deep links that are accessible to both - signed-in users and those who aren't. Google Search app users must be signed in to see deep links +
Chrome displaying google.com serves search results with URLs that are accessible to both + signed-in users and those who aren't. Google Search app users must be signed in to see URLs in their search results.
Android Studio helps you test your code with the following features:
The details for implementing deep links and app indexing are described next. +
The details for implementing URL support and app indexing are described next. -
To use Android Studio features to add an intent filter defining a deep link, follow these - steps:
+To use Android Studio features to add an intent filter defining a URL:
- and select Create Deep Link.<activity> element and select Generate
- > Deep Link.The Code Editor adds skeleton code using the @@ -154,7 +162,7 @@ page.tags=app indexing
The Code Editor adds an intent filter similar to the following:
<!-- ATTENTION: This intent was auto-generated. Follow instructions at
- https://g.co/AppIndexing/AndroidStudio to publish your Android app deep links. -->
+ https://g.co/AppIndexing/AndroidStudio to publish your URLs. -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
@@ -177,19 +185,20 @@ page.tags=app indexing
We recommend that you define a <data> element that supports URLs that you’ll
add in the future. In the previous sample code, for example, Google will index any URLs starting
- with www.example.com/gizmos. Also, remember to
- include a deep link for your app home screen so it’s included in search results.
+ with http://www.example.com/gizmos. Also, remember to
+ include a URL for your app home screen so it’s included in search results.
-Deep link URLs can be the same as the URLs of the comparable pages on your website.
+The URLs you specify in your intent filters can be the same as the URLs of
+the comparable pages on your website.
To support Google Search for your deep links, follow these steps:
+To support Google Search for your URLs:
To test and debug your links, you can use the following Android Studio features:
In addition, you can preview your APK in the Google Search Console - to test your deep links, whether the app is associated with a website or not.
+ to test your URLs, whether the app is associated with a website or not.After adding deep links, you can add App Indexing API code to an activity to support additional - search features.
+After adding URL support to your app, you can add App Indexing API code to +an activity to support additional search features.
-To add App Indexing API code to an activity, follow these steps:
+To add App Indexing API code to an activity:
In addition, you can @@ -371,12 +383,12 @@ page.tags=app indexing class="external-link">preview your APK in the Google Search Console.
-When you run your app from Android Studio, you can specify a deep link to launch so you can +
When you run your app from Android Studio, you can specify a URL to launch so you can test it.
-To launch a deep link from Android Studio, follow these steps:
+To launch a URL from Android Studio:
Or type the URL you want to test, for example, http://example.com/gizmos.
If the link is successful, the app launches in the device or emulator, and displays the app at @@ -411,12 +423,12 @@ page.tags=app indexing
The logcat Monitor can display app indexing log messages to determine if your App Indexing API code is pushing the correct data to the cloud. For example, you can check the app title and the - URL. The logcat Monitor is part of Android Monitor in Android Studio.
+ URL. The logcat Monitor is part of Android Monitor in Android Studio. -Follow these steps:
+To view App Indexing API messages in the logcat Monitor:
You can use the Android Studio built-in Lint tool to check whether you have valid deep links +
You can use the Android Studio built-in Lint tool to check whether you have valid URLs defined in the manifest and have implemented the App Indexing API correctly in activities.
-You can view deep link and app indexing warnings and errors in two ways:
+You can view URL and app indexing warnings and errors in two ways:
To set default Lint checks for deep links and the App Indexing API, follow these steps:
+To set default Lint checks for URLs and the App Indexing API:
For example, the following Lint warning appears for the first setting:
-

To produce a list of Lint checks displayed in the Inspection Results window, - follow these steps:
+To produce a list of Lint checks displayed in the Inspection Results window:
In the Inspections dialog, you can search for the string "app indexing" -to find the deep link and App Indexing API Lint checks. Note that changing Lint settings for a +to find the URL and App Indexing API Lint checks. Note that changing Lint settings for a profile in the Inspections dialog doesn’t change the default settings, as described in the previous procedure. It does change the settings for profiles displayed in the Inspections dialog, however.
@@ -512,3 +523,87 @@ the previous procedure. It does change the settings for profiles displayed in thThe results appear in the Inspection Results window.
You can use a Google App Indexing Test to check whether Google can index +a URL by either crawling your app page or using the App Indexing API. +Google can index the URL if your app supports at least one of the following: +
+To perform a Google App Indexing Test:
+Android Studio builds the APK and starts the test. The test can take a few +minutes to complete. The results appear in a new tab in the Code Editor.
+
If the app preview on the right shows the screen that corresponds to the URL +you're testing, then Googlebot can find the URL.
+ +The following table lists common errors and warnings you might encounter.
+ +| Warning or Error | +Description | +
|---|---|
| Error: Google cannot index this page. | +Your app can't be crawled by Googlebot or using the App Indexing API, + so Google isn't able to index this app. | +
| Warning: The App URL you sent by using the App Indexing API doesn't + match the URL opened. | +When calling the App Indexing API, the URL specified in the app must + match the opened URL. | +
| Warning: Google cannot index this page using the App Indexing API + because the title is empty. | +When calling the App Indexing API, the title shouldn't be empty. | +
| Warning: Google can index this page using Googlebot crawling but + identified blocked resources. | +The app references other resources, and some of them are blocked or
+ temporarily unavailable. If these resources aren't critical, it might not
+ matter. Check the preview on the right to see whether the content
+ displays correctly. To fix this issue, make sure the resources aren't
+ blocked by robots.txt. |
+
| Warning: Google cannot index this page using the App Indexing API. | +Your app isn’t using the App Indexing API. We recommended adding App + Indexing API support to your app. | +