Client that exposes the Places API methods. To get a PlacesClient
, use createClient(android.content.Context)
.
Public Method Summary
abstract Task<FetchPhotoResponse> | |
abstract Task<FetchPlaceResponse> | |
abstract Task<FindAutocompletePredictionsResponse> |
findAutocompletePredictions(FindAutocompletePredictionsRequest request)
Fetches autocomplete predictions.
|
abstract Task<FindCurrentPlaceResponse> |
findCurrentPlace(FindCurrentPlaceRequest request)
Fetches the approximate current location of the user's device.
|
Public Methods
public abstract Task<FetchPhotoResponse> fetchPhoto (FetchPhotoRequest request)
Fetches a photo.
The photos service may cache the image data. If the requested photo does not exist in the cache then a network lookup will be performed.
Parameters
request | The request specifying the photo to request. |
---|
Returns
- response containing the photo requested or an
ApiException
if an error occurred.
public abstract Task<FetchPlaceResponse> fetchPlace (FetchPlaceRequest request)
Fetches the details of a place.
Parameters
request | The request specifying the place of interest. |
---|
Returns
- Response containing the place of interest or an
ApiException
if an error occurred.
public abstract Task<FindAutocompletePredictionsResponse> findAutocompletePredictions (FindAutocompletePredictionsRequest request)
Fetches autocomplete predictions.
Parameters
request | The request specifying details of the autocomplete query. |
---|
Returns
- Response containing the list of prediction objects or an
ApiException
if an error occurred.
public abstract Task<FindCurrentPlaceResponse> findCurrentPlace (FindCurrentPlaceRequest request)
Fetches the approximate current location of the user's device.
The device must have Location Services enabled, and the app must have the following permissions granted.
ACCESS_FINE_LOCATION
(dangerous permission)ACCESS_WIFI_STATE
(normal permission). Note that the library's manifest already includes this, so it should be automatically merged into the app's (APK's) manifest.
SecurityException
being thrown.Parameters
request | the request specifying filtering details. |
---|
Returns
- response containing the user's current place candidates or an
ApiException
if an error occurred.