android - 我不完全了解应用索引

标签 android android-app-indexing google-app-indexing firebase-app-indexing

好吧,我明白了,如果我有一个网站和一个大致显示相同内容的应用程序,则可以使用应用程序索引在应用程序中打开指向该网站的链接(如果用户安装了它)。

为此,需要在网页中指定深层链接,这些链接指定应用程序和内容的 URI。这也让 Googlebot 知道网页到应用程序的 Intent 连接,以便它可以在搜索结果等中显示内容(即 indexing)。还可以指定处理网站 URL 的 intent-filters,这样指向您网站的链接就可以自动打开应用程序并在其中显示内容,甚至无需在浏览器中打开网页。

我无法理解的部分是,在 Android 应用程序中,您添加了“相反方向”的代码(可以由 Android Studio 自动生成)。

例如

@Override
public void onStart() {
    super.onStart();

    // ATTENTION: This was auto-generated to implement the App Indexing API.
    // See https://g.co/AppIndexing/AndroidStudio for more information.
    client.connect();
    Action viewAction = Action.newAction(
            Action.TYPE_VIEW, // TODO: choose an action type.
            "Main Page", // TODO: Define a title for the content shown.
            // TODO: If you have web page content that matches this app activity's content,
            // make sure this auto-generated web page URL is correct.
            // Otherwise, set the URL to null.
            Uri.parse("http://host/path"),
            // TODO: Make sure this auto-generated app URL is correct.
            Uri.parse("android-app://com.magnuswikhog.adrlibrary/http/host/path")
    );
    AppIndex.AppIndexApi.start(client, viewAction);
}

那么这段代码的目的是什么?与网站到应用程序的 Intent 相比,这似乎是另一种方式,我真的不明白你为什么需要这样做?如果我只实现深层链接和处理 URL Intent ,用户将能够打开应用程序而不是网页,而不需要 AppIndex

这主要是 Google 收集有关应用程序用户如何使用具有相应网页的屏幕的统计数据的一种方式吗?如果有,这有什么影响?它会影响应用排名(和/或网站排名吗?)如果我正在实现应用索引的所有其他部分,是否有必要实现这一点?

最佳答案

好吧,看来我混淆了 App Indexing 和 App Links。我敢肯定我不是一个人这样做,因为即使是 Google 似乎也可以互换使用这些术语并且不严格 - 例如,如果您选择 Tools -> Firebase App Indexing Test 并且测试失败,当你点击 Learn more您将被带到一个页面,其中 90% 都是关于应用链接的,底部是关于应用索引的一小段。

这一段是这样说的:

Add Firebase App Indexing

After adding Android App Links to your app, you can add Firebase App Indexing code to an activity to get re-engagement to your app from additional Google Search features, including autocomplete suggestions and In Apps search. Learn more about Firebase App Indexing in the Firebase App Indexing documentation.

因此,App Indexing 似乎与 App Links 没有直接关联,并且在某种意义上是完全不同的功能。

此外,查看 the Firebase documentation , 最后是关于索引代码用途的一些真实信息:

Log User Actions

Google Search takes into account the actions users take on public and personal app content and uses that to provide improved ranking for Search results and suggestions. Log user actions in your app to improve your users' experience when they search for content in your app.

关于android - 我不完全了解应用索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43084814/

相关文章:

iOS 通用链接和 GET 参数

java - android studio 接受导入内部类吗?

android - 无法为 Android 编译 NME

android - 将数据从 dialogfragment 传递到 fragment

java - 在android中迭代它时从堆栈中删除一个项目

android - 包管理器 : Not granting permission - Android M

android - 如何停止 Android Studio 提示 "Insert App Indexing"快速修复?

Android firebase app indexing 搜索建议更新周期