Android Open Source - android-async-google-places Place Photos






From Project

Back to project page android-async-google-places.

License

The source code is released under:

Apache License

If you think the Android project android-async-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 io.github.axxiss.places.request;
// w  ww. j  a  v  a2 s  .co  m
import io.github.axxiss.places.enums.Params;

/**
 * The Places Photo service is a read-only API that allows you to easily add high quality
 * photographic content to your application. The Photo service gives you access to the millions of
 * photos stored in the Places and Google+ Local database. When you search for Places using either a
 * Place Search or Place Details request, photo references will be returned for relevant
 * photographic content. The Photo service lets you access the referenced photos, and resize the
 * image to the optimal size for your application.
 *
 * @author Axxiss
 */
public class PlacePhotos {
    protected static final String PHOTO = "photo";

    PlaceParams params = new PlaceParams();

    /**
     * All requests to the Place Photo service must include a photoreference, returned in the
     * response to a Place Search or Place Details request. The response to either service will
     * contain a photos[] field if that Place has related photographic content. The number of photos
     * returned varies by request. A Place Search will return at most one photo element in the array
     * while the Details request will return up to ten photo elements.
     * <p/>
     * Photos returned by the Photo service are sourced from a variety of locations, including
     * business owners and Google+ users contributed photos. In most cases, these photos can be used
     * without attribution, or will have the required attribution included as a part of the image.
     * However, if the returned photo element includes a value in the html_attributions field, you
     * will have to include the additional attribution in your application wherever you display the
     * image.
     *
     * @param reference place's reference
     * @return
     */
    public PlacePhotos(final String reference, final int maxHeight, final int maxWidth) {
        params.put(Params.PhotoReference, reference);
        params.put(Params.MaxHeight, maxHeight);
        params.put(Params.MaxWidth, maxWidth);
    }
}




Java Source Code List

io.github.axxis.places.sample.MainActivity.java
io.github.axxis.places.sample.PlaceActivity.java
io.github.axxiss.places.PlacesSettings.java
io.github.axxiss.places.Response.java
io.github.axxiss.places.callback.PhotoCallback.java
io.github.axxiss.places.callback.PlacesCallback.java
io.github.axxiss.places.enums.Params.java
io.github.axxiss.places.enums.PlaceType.java
io.github.axxiss.places.enums.Price.java
io.github.axxiss.places.enums.RankBy.java
io.github.axxiss.places.enums.Request.java
io.github.axxiss.places.enums.Status.java
io.github.axxiss.places.exception.ApiPlacesException.java
io.github.axxiss.places.listeners.OnPlaceClickListener.java
io.github.axxiss.places.model.AddressComponent.java
io.github.axxiss.places.model.AspectRating.java
io.github.axxiss.places.model.Event.java
io.github.axxiss.places.model.Geometry.java
io.github.axxiss.places.model.Location.java
io.github.axxiss.places.model.OpeningHours.java
io.github.axxiss.places.model.PeriodData.java
io.github.axxiss.places.model.Period.java
io.github.axxiss.places.model.Photo.java
io.github.axxiss.places.model.Place.java
io.github.axxiss.places.model.Review.java
io.github.axxiss.places.request.BaseSearch.java
io.github.axxiss.places.request.NearbySearch.java
io.github.axxiss.places.request.PlaceDetails.java
io.github.axxiss.places.request.PlaceParams.java
io.github.axxiss.places.request.PlacePhotos.java
io.github.axxiss.places.request.PlaceSearch.java
io.github.axxiss.places.request.PlacesClient.java
io.github.axxiss.places.request.RadarSearch.java
io.github.axxiss.places.request.TextSearch.java