Hao Tran
Hao Tran

Reputation: 3

App activities in Google

I'm working on Android project with Google+ feature. I'm reading an article here: https://developers.google.com/+/mobile/android/app-activities

I understand sample below code:

ItemScope target = new ItemScope.Builder()
      .setUrl(targetUrl)
      .build();
Moment moment = new Moment.Builder()
      .setType("http://schemas.google.com/ReviewActivity")
      .setTarget(target)
      .setResult(result)
      .build();

But I don't know the below code, what is the purpose of the 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();

And I have seen source of the link : https://developers.google.com/+/web/snippet/examples/review. It contain name, reviewRating,... Why we need "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>

Upvotes: 0

Views: 130

Answers (1)

abraham
abraham

Reputation: 47833

The URL would be a page on your site that represents the specific activity that happened. The page on your server should contain the correct Schema.org markup for the activity that is being created. The review example is just an example and you can add or remove any attributes you want as long as you conform to the Schema.org standard.

Upvotes: 2

Related Questions