Android 谷歌的应用程序活动
我正在做一个有Google+功能的Android项目。我在这里读一篇文章: 我理解以下代码示例:Android 谷歌的应用程序活动,android,google-plus,Android,Google Plus,我正在做一个有Google+功能的Android项目。我在这里读一篇文章: 我理解以下代码示例: ItemScope target = new ItemScope.Builder() .setUrl(targetUrl) .build(); Moment moment = new Moment.Builder() .setType("http://schemas.google.com/ReviewActivity") .setTarget(targ
ItemScope target = new ItemScope.Builder()
.setUrl(targetUrl)
.build();
Moment moment = new Moment.Builder()
.setType("http://schemas.google.com/ReviewActivity")
.setTarget(target)
.setResult(result)
.build();
但是我不知道下面的代码,setUrl的用途是什么?
ItemScope rating = new ItemScope.Builder()
.setType("http://schema.org/Rating")
.setRatingValue("100")
.setBestRating("100")
.setWorstRating("0")
.build();
ItemScope result = new ItemScope.Builder()
.setType("http://schema.org/Review")
.setName("A Humble Review of Widget")
.setUrl("https://developers.google.com/+/web/snippet/examples/review")
.setDescription("It is amazingly effective")
.setReviewRating(rating)
.build();
我已经看到了链接的来源:。它包含名称、评论、评论等为什么我们需要“setname”、“setRatingValue”和…
<!DOCTYPE html>
<html>
<head>
<title>A Review</title>
</head>
<body itemscope itemtype="http://schema.org/Review">
<section>Name: <div itemprop="name">A Humble Review of Widget</div></section>
<section>
<a itemprop="url" href="https://developers.google.com/+/web/snippet/examples/review">
A link to this review</a>
</section>
<section>
Text:
<p itemprop="text">It is amazingly effective at whatever it is that it is supposed to do.</p>
</section>
<section itemprop="reviewRating" itemscope itemtype="http://schema.org/Review">
<span itemprop="worstRating">0</span> to <span itemprop="bestRating">100</span> rating: <span itemprop="ratingValue">100</span>
</section>
</body>
</html>
评论
名称:小工具简评
正文:
无论它应该做什么,它都非常有效
0至100级:100
URL将是站点上的一个页面,表示发生的特定活动。服务器上的页面应包含所创建活动的正确Schema.org标记。回顾示例只是一个示例,只要符合Schema.org标准,您就可以添加或删除任何想要的属性。谢谢abraham,但当我在“setname”中更改名称时,…,在Google App Activity中似乎什么都没有更改?有很多可能性。如果包含URL,我相信页面上的属性会覆盖通过API设置的属性setName
可能仅适用于支持name属性的itemtypes。名称实际上可能会被保存,但只是没有显示在UI中,可能活动会通过API进行保存。是的,得到了。我怎样才能得到一个用户的评论?(评级…)。有点困惑,用户如何看待谷歌搜索结果页面中的平均评论?谷歌似乎只在1次内将评论保存为“目标url”和“结果url”。之后,当用户更改评论(或其他内容)时,应用上的时刻活动将被更新(不是创建新时刻)。这些活动不会与搜索结果集成。一个包含平均评论的通用产品页面必须由谷歌为此编制索引。