Android Open Source - OpenFoodFinder Place

From Project

Back to project page OpenFoodFinder.


The source code is released under:

Apache License

If you think the Android project OpenFoodFinder 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

// w w  w .ja  va2  s . c  om
import android.os.Parcel;
import android.os.Parcelable;

//need to import GooglePlayServices

/*Interface, lets you pass place object through intents. Like serializable, but more xxXXmlgswagXXxx*/
public class Place implements Parcelable{
    private String name;
    private String iconURL;
    private LatLng location;
    private String address;
    private Double rating;
    /** constructor **/
    public Place(String name, Double lat, Double lng, String address, Double rating, String iconURL) { = name;
      this.address = address;
      this.rating = rating;
      this.iconURL = iconURL;
      setLocation(lat, lng);
  public void setLocation(Double lat, Double lng) {
    this.location = new LatLng(lat, lng);

  public String getName() {
    return name;

  public String getIconURL() {
    return iconURL;
  public LatLng getLocation() {
    return location;

  public String getAddress() {
    return address;

  public Double getRating() {
    return rating;
    public String toString() {
        return name;

  /*Constructor, converts parcel object back into class instance*/
  private Place (Parcel in) {
    name = in.readString();
    address = in.readString();
    rating = in.readDouble();
    iconURL = in.readString();
  public int describeContents() {
    // TODO Auto-generated method stub
    return 0;

  /*Instance to parcel conversion*/
  public void writeToParcel(Parcel out, int flags) {
    location.writeToParcel(out, flags);
    public static final Parcelable.Creator<Place> CREATOR = new Parcelable.Creator<Place>() {
        public Place createFromParcel(Parcel in) {
            return new Place(in);

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

Java Source Code List