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

public abstract AsyncResource<List<PlacePrediction>> autocomplete(String input, String sessionToken, LatLng bias)Suggests places for partial input.
public abstract AsyncResource<PlaceDetails> getDetails(String placeId, String sessionToken)Resolves a suggestion.

Method details

autocomplete

public abstract AsyncResource<List<PlacePrediction>> autocomplete(String input, String sessionToken, LatLng bias)
Suggests places for partial input.

Parameters

input String
what the user typed
sessionToken String
groups the requests of one search for billing; may be ignored
bias LatLng
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

placeId String
the ID of a prediction
sessionToken String
the token used for the autocomplete requests

Returns

the details