Search

Places

You can search Points Of Interest (POI) near a location via Places api. By defining PoiInfo.PoiCategory or PoiInfo.PoiGroup you can search places of certain type (eg. find restaurants around user). All places can be searched by passing PoiInfo.PoiGroup.Unknown.

Places places = new Places();
GeoCoordinates position = new GeoCoordinates(42.673, 19.144);
CategoryRequest request = new CategoryRequest(position, PoiInfo.PoiCategory.Restaurant, 200);
places.searchPlaces(request, new Places.PlacesListener() {
    @Override
    public void onPlacesLoaded(final List<Place> list) {
        // process places
    }
});

places.searchPlaces(new GroupRequest(position, PoiInfo.PoiGroup.Accommodation, 1000),
        new Places.PlacesListener() {
            @Override
            public void onPlacesLoaded(final List<Place> list) {
                // process places
            }
        });

Reverse geocoding

Reverse geocoding is opposite process to geocoding, meaning you query by geographical location and receive textual address of the location.

ReverseGeocoder reverseGeocoder = new ReverseGeocoder();
GeoCoordinates position = new GeoCoordinates(42.673, 19.144);
reverseGeocoder.search(position, new ReverseGeocoder.ReverseSearchResultsListener() {
    @Override
    public void onSearchResults(@NonNull final List<ReverseSearchResult> results, @NonNull final GeoCoordinates position) {
        for (final ReverseSearchResult result : results) {
            String country = result.getNames().getCountryIso();
            String city = result.getNames().getCity();
            String street = result.getNames().getStreet();
        }
    }
});