Existing Google Places API java source implemented for a special query purpose.
-
Before start using it, you've got to obtain an API key. Visit the developer's guide for more information.
-
Drop the googleplaces.jar in the lib folder of your Android project.
-
In order to mismatching issues, I've moved out the Android Support V4 from libs folder (libs/android-support-v4.jar). As a best practice, keep in mind that you might want to include it on your own project instead of the Google Places Android one.
Some Examples:
Sending a search request
GooglePlaces googlePlaces = new GooglePlaces("Your API Key");
PlacesResult result = googlePlaces.getPlaces("restaurant", 500, -20.28142, -40.301564);
PlacesResult result = googlePlaces.getPlaces("dinner", "meal", 500, -20.28142, -40.301564);
PlacesResult result = googlePlaces.getPlaces("hamburger", -20.28142, -40.301564);
Sending a Place Details request
Place somePlace = result.getPlaces().get(0);
DetailsResult detailsResult = googlePlaces.getPlaceDetails(somePlace.getReference());