Android Open Source - android-google-places Place Review






From Project

Back to project page android-google-places.

License

The source code is released under:

Copyright (c) 2012 Greg Marzouka Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Soft...

If you think the Android project android-google-places listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.gmarz.googleplaces.models;
//  ww  w.  j a v a  2  s.  c o  m
import org.json.JSONException;
import org.json.JSONObject;

import android.os.Parcel;
import android.os.Parcelable;

public class PlaceReview implements Parcelable {

  private int mRating = 0;
  private String mAuthorName = "";
  private String mText = "";

  private PlaceReview(Parcel in) {
    mRating = in.readInt();
    mAuthorName = in.readString();
    mText = in.readString();
  }
  
  public PlaceReview(JSONObject jsonReview) {
    try {
      mRating = jsonReview.getJSONArray("aspects").getJSONObject(0).getInt("rating");
      mAuthorName = jsonReview.getString("author_name");
      mText = jsonReview.getString("text");
    } catch(JSONException e) {
      e.printStackTrace();
    }
  }

  public int getRating() {
    return mRating;
  }
  
  public String getAuthorName() {
    return mAuthorName;
  }
  
  public String getText() {
    return mText;
  }
  
  public int describeContents() {
    return 0;
  }

  public void writeToParcel(Parcel out, int flags) {
    out.writeInt(mRating);
    out.writeString(mAuthorName);
    out.writeString(mText);
  }
  
  public static final Parcelable.Creator<PlaceReview> CREATOR = new Parcelable.Creator<PlaceReview>() {

    public PlaceReview createFromParcel(Parcel in) {
      return new PlaceReview(in);
    }

    public PlaceReview[] newArray(int size) {
      return new PlaceReview[size];
    }
  };
}




Java Source Code List

org.gmarz.googleplaces.GooglePlaces.java
org.gmarz.googleplaces.models.DetailsResult.java
org.gmarz.googleplaces.models.PlaceDetails.java
org.gmarz.googleplaces.models.PlaceReview.java
org.gmarz.googleplaces.models.Place.java
org.gmarz.googleplaces.models.PlacesResult.java
org.gmarz.googleplaces.models.Result.java
org.gmarz.googleplaces.query.DetailsQuery.java
org.gmarz.googleplaces.query.NearbySearchQuery.java
org.gmarz.googleplaces.query.QueryBuilder.java
org.gmarz.googleplaces.query.Query.java
org.gmarz.googleplaces.query.SearchQuery.java
org.gmarz.googleplaces.query.TextSearchQuery.java