Places SDK for Android supports the existing Place Photo. If you are familiar with the existing Place Photo, the new version of Place Photo makes the following changes:
Uses a new pricing model. For pricing information for all APIs, see Places SDK for Android (New).
The existing Place Photo returns a bitmap image. Place Photo (New) returns a URI to the image.
The existing Place Photo supported a maximum photo size of 1600 by 1600 pixels. Place Photo (New) supports sizes up to 4800 by 4800 pixels.
To make a request, call the new
PlacesClient.fetchResolvedPhotoUri()
method.You can only call the
PlacesClient.fetchPhoto()
method if you enable Places API. That method is not available when you only enable Places API (New).For more information, see Use API Keys.
Pass to the request an object of the new
FetchResolvedPhotoUriRequest
class.Each photo in the response is represented by a
PhotoMetadata
object. For Places SDK for Android (New) thePhotoMetadata
object contains a newPhotoMetadata.getAuthorAttributions()
method that returns an object of typeAuthorAttributions
.If the returned
PhotoMetadata
object includes any attributions or author attribution, you must include these attributions in your application wherever you display the image. See the documentation on attributions.To access the new author attributions in
PhotoMetadata
you must initialize your app by calling thePlaces.initializeWithNewPlacesApiEnabled()
method. For more information on selecting the Places API service, see Set up your Google Cloud project.
Example request
For a complete example, see Place Photo (New).