Android官方培训文档翻译(一)——Handling App Links

Handling Android App Links (处理Android应用程序链接)

  Users following links on devices have one goal in mind: to get to the content they want to see. As a developer, you can set up Android App Links to take users to a link's specific content directly in your app, bypassing the app-selection dialog, also known as the disambiguation dialog. Because Android App Links leverage HTTP URLs and association with a website, users who don't have your app installed go directly to content on your site.
  用户通过设备上的链接实现一个目标:获得他们想看的内容。作为一名开发人员,您可以设置Android应用程序链接,让用户直接在应用程序中获取链接的特定内容,绕过应用程序选择对话框(也称为消除歧义对话框)。由于Android应用链接利用HTTP网址并与网站关联,因此没有安装应用的用户将直接访问您网站上的内容。

Deep linking and Android App Links (深层链接和Android应用程序链接)

  Deep links are URLs that take users directly to specific content in your app. In Android, you can set up deep links by adding intent filters and extracting data from incoming intents to drive users to the right activity.
  深层链接是将用户直接带到应用中特定内容的网址。在Android中,您可以通过添加意图过滤器并从传入的意图中提取数据来设置深层链接,以将用户驱动到正确的活动。

  However, if other apps installed on a user's device can handle the same intent, users might not go directly to your app. For example, clicking a URL in an email from a bank might lead to a dialog asking the user whether to use the browser or the bank's own app to open the link.
  但是,如果安装在用户设备上的其他应用可以处理相同的意图,则用户可能不会直接进入您的应用。例如,点击银行电子邮件中的URL可能会导致询问用户是使用浏览器还是银行自己的应用程序来打开链接。

  Android App Links on Android 6.0 (API level 23) and higher allow an app to designate itself as the default handler of a given type of link. If the user doesn't want the app to be the default handler, they can override this behavior from their device's system settings.
  Android 6.0(API level 23)及更高版本上的Android App Links允许应用程序将自己指定为给定类型链接的默认处理程序。如果用户不希望该应用成为默认处理程序,则可以从其设备的系统设置中覆盖此行为。

Android官方培训文档翻译(一)——Handling App Links_第1张图片
Deep links and App links differences

Android App Links offer the following benefits:

  • Secure and specific: Android App Links use HTTP URLs that link to a website domain you own, so no other app can use your links. One of the requirements for Android App Links is that you verify ownership of your domain through one of our website association methods.
  • Seamless user experience: Since Android App Links use a single HTTP URL for the same content on your website and in your app, users who don’t have the app installed simply go to your website instead of the app — no 404s, no errors.
  • Android Instant Apps support: With Android Instant Apps, your users can run your Android app without installing it. To add Instant App support to your Android app, set up Android App Links and visit g.co/InstantApps.
  • Engage users from Google Search: Users directly open specific content in your app by clicking a URL from Google in a mobile browser, in the Google Search app, in screen search on Android, or through Google Assistant.

Android应用程序链接提供以下好处:

  • 安全和具体: Android应用程序链接使用链接到您拥有的网站域的HTTP URL,所以没有其他应用程序可以使用您的链接。 Android应用程序链接的要求之一是您通过我们的网站关联方法之一来验证您的域的所有权。
  • 无缝的用户体验: 由于Android App Links为您的网站和应用中的相同内容使用单个HTTP URL,所以没有安装该应用的用户只需进入您的网站而不是应用 - 无404s,无错误。
  • Android即时应用支持: 使用Android即时应用,您的用户可以在不安装的情况下运行Android应用。要为您的Android应用程序添加即时应用程序支持,请设置Android应用程序链接并访问g.co/InstantApps。
  • 从Google搜索中吸引用户: 用户可以通过在移动浏览器,Google搜索应用,Android屏幕搜索或Google智能助理中点击来自Google的网址,直接打开应用中的特定内容。

Add Android App Links
添加Android应用程序链接

The general steps for creating Android App Links are as follows:

  1. Create deep links to specific content in your app: In your app manifest, create intent filters for your website URIs and configure your app to use data from the intents to send users to the right content in your app. Learn more in Create Deep Links to App Content.
  2. Add verification for your deep links: Configure your app to request verification of app links. Then, publish a Digital Asset Links JSON file on your websites to verify ownership through Google Search Console. Learn more in Verify App Links.

创建Android应用链接的一般步骤如下:

  1. 创建应用程序中特定内容的深层链接:在您的应用程序清单中,为您的网站URI创建意图过滤器,并配置您的应用程序以使用意图中的数据将用户发送到应用程序中的正确内容。在创建应用内容的深层链接中了解更多信息。
  2. 为您的深层链接添加验证: 配置您的应用以请求验证应用链接。然后,在您的网站上发布数字资产链接JSON文件,以通过Google Search Console验证所有权。

  As an alternative to the documentation linked above, the Android App Links Assistant is a tool in Android Studio that guides you through each of the steps required to create Android App Links.
  在验证应用链接中了解更多信息 作为上面链接的文档的替代,Android应用程序链接助手是Android Studio中的一个工具,可指导您完成创建Android应用程序链接所需的每个步骤。

原文链接:
https://developer.android.com/training/app-links/index.html

你可能感兴趣的:(Android官方培训文档翻译(一)——Handling App Links)