Places SDK for Android supports Place Photos (Legacy). If you are familiar with Place Photos (Legacy), Place Photos (New) makes the following changes:
Uses a new pricing model. For pricing information for all APIs, see Places SDK for Android (New).
Place Photos (Legacy) returns a bitmap image. Place Photos (New) returns a URI to the image.
Place Photos (Legacy) supported a maximum photo size of 1600 by 1600 pixels. Place Photos (New) supports sizes up to 4800 by 4800 pixels.
To make a request, call the new
PlacesClient.fetchResolvedPhotoUri()method.For more information, see Use API Keys.
Pass to the request an object of the new
FetchResolvedPhotoUriRequestclass.Each photo in the response is represented by a
PhotoMetadataobject. For Places SDK for Android (New) thePhotoMetadataobject contains a newPhotoMetadata.getAuthorAttributions()method that returns an object of typeAuthorAttributions.If the returned
PhotoMetadataobject 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
PhotoMetadatayou 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 Photos (New).