Android library that wraps the Google Places API.
-
Obtain an API key. Visit the developer's guide for more information.
-
Drop the googleplaces.jar in the lib folder of your Android project.
A few examples...
Sending a search request
GooglePlaces googlePlaces = new GooglePlaces("Your API Key");
PlacesResult result = googlePlaces.getPlaces("food", 500, 40.764941, -73.984886);
PlacesResult result = googlePlaces.getPlaces("food", "steakhouse", 500, 40.764941, -73.984886);
PlacesResult result = googlePlaces.getPlaces("diners", 40.764941, -73.984886);
Handling a place search response
if (result.getStatusCode() == StatusCode.OK) {
List<Place> places = result.getPlaces();
}
Sending a Place Details request
Place somePlace = result.getPlaces().get(0);
DetailsResult detailsResult = googlePlaces.getPlaceDetails(somePlace.getReference());
Handling a place details response
if (detailsResult.getStatusCode() == StatusCode.OK) {
PlaceDetails details = detailsResult.getDetails();
}
Fork, push, and send a pull request.