Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public interface PlacesProvider
Known subtypesGooglePlacesProvider, PhotonPlacesProvider
A place search service behind
PlacesAutocomplete.
PhotonPlacesProvider needs no key; GooglePlacesProvider uses the
Google Places API (New).Methods
Method details
autocomplete
public abstract AsyncResource<List<PlacePrediction>> autocomplete(String input, String sessionToken, LatLng bias)Suggests places for partial input.
Parameters
inputString- what the user typed
sessionTokenString- groups the requests of one search for billing; may be ignored
biasLatLng- prefers results near this point, may be null
Returns
the suggestions
getDetails
public abstract AsyncResource<PlaceDetails> getDetails(String placeId, String sessionToken)Resolves a suggestion. This ends the session the token names.
Parameters
placeIdString- the ID of a prediction
sessionTokenString- the token used for the autocomplete requests
Returns
the details