Skip to content

Repository files navigation

Google Places API - Java

This is a lightweight Java wrapper of the Google Places API supporting common query actions including search, detail, and autocomplete.

Example Usage

Search Nearby

GooglePlacesplaces = newGooglePlaces( "API_KEY" );
PlacesResultresult = places.searchNearby( 40.10744f, -88.22724f, 5000, PlacesQueryOptions.create( ).keyword( "siebel center" ) );
System.out.println( result.getStatus( ) );
for ( Placeplace : result )
System.out.println( place.getName( ) + " " + place.getGeometry( ).getLocation( ) );

Search Text

GooglePlacesplaces = newGooglePlaces( "API_KEY" );
PlacesResultresult = places.searchText( "Pizza in Champaign, IL" );
System.out.println( result.getStatus( ) );
for ( Placeplace : result )
System.out.println( place.getName( ) + ", " + place.getFormattedAddress( ) );

Detail

GooglePlacesplaces = newGooglePlaces( "API_KEY" );
PlaceDetailResultresult = places.detail( place.getPlaceId( ) );

Autocomplete

GooglePlacesplaces = newGooglePlaces( "API_KEY" );
AutocompleteResultresult = places.autocomplete( "Siebel Ce" );
for ( Predictionp : result )
System.out.println( p.getDescription( ) );

Dependencies

License

See the LICENSE file for rights and limitations under the terms of the MIT license.

Downloads

Source is hosted on GitHub.

About

An uncomplicated Java client for the Google Places API

Topics

Resources

Stars

10 stars

Watchers

6 watching

Forks

Releases

Packages

Used by

Contributors

Languages