Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/222.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Firebase应用程序索引和Gboard标签包:hasSticker vs iPartof vs partOf_Java_Android_Firebase App Indexing_Gboard - Fatal编程技术网

Java Firebase应用程序索引和Gboard标签包:hasSticker vs iPartof vs partOf

Java Firebase应用程序索引和Gboard标签包:hasSticker vs iPartof vs partOf,java,android,firebase-app-indexing,gboard,Java,Android,Firebase App Indexing,Gboard,在这种情况下,似乎有两种不同的方法将“贴纸”与“贴纸包”关联起来 在方法1中,创建一个贴纸包,然后使用名为“hasSticker”的键调用put将贴纸与之关联: 方法#1 new Indexable.Builder("StickerPack") .setName("Snoopy Pack") .setImage("content://sticker/pack/canonical/image") // see: Support links to your app content

在这种情况下,似乎有两种不同的方法将“贴纸”与“贴纸包”关联起来

在方法1中,创建一个贴纸包,然后使用名为“hasSticker”的键调用put将贴纸与之关联:

方法#1

new Indexable.Builder("StickerPack")
   .setName("Snoopy Pack")
   .setImage("content://sticker/pack/canonical/image")
   // see: Support links to your app content section
   .setUrl("http://sticker/pack/canonical/url/snoopy")
   // Set the accessibility label for the sticker pack.
   .setDescription("A sticker pack of Snoopy")
   .put("hasSticker",
        new Indexable.Builder("Sticker")
          .setName("Hey")
          .setImage("http://link/to/the/image/hey")
          .setDescription("A Snoopy hey sticker.")
          .build(),
       new Indexable.Builder("Sticker")
          .setName("Bye")
          .setImage("http://link/to/the/image/bye")
          .setDescription("A Snoopy bye sticker.")
          .build())
   .build());
在方法2中,创建一个贴纸,然后使用名为“isPartOf”的键调用put将贴纸包与其关联:

方法#2

new Indexable.Builder("Sticker")
   .setName("Hey")
   .setImage("http://www.snoopysticker.com?id=1234")
   // see: Support links to your app content section
   .setUrl("http://sticker/canonical/image/hey")
   // Set the accessibility label for the sticker.
   .setDescription("A sticker for hi")
   // Add search keywords.
   .put("keywords", "hey", "snoopy", "hi", "hello")
   .put("isPartOf",
        new Indexable.Builder("StickerPack")
          .setName("Snoopy Pack"))
          .build())
   .build()),
为了使水变得浑浊,他们会遇到一些麻烦,同时使用Hassicker和isPartOf方法。为了让它更有趣,“isPartOf”将其名称改为“partOf”:

在定义贴纸及其与贴纸包的关系时,同时使用“hasSticker”和“isPartOf”有什么好处吗?或者仅仅使用其中一个就足够了

哪一个是正确的:“部分”或“部分”——或者两者都正确

indexableStickerBuilder.put("keywords", "tag1_" + i, "tag2_" + i)
    // StickerPack object that the sticker is part of.
    .put("partOf", new Indexable.Builder("StickerPack")
        .setName(CONTENT_PROVIDER_STICKER_PACK_NAME)
        .build());