Back to project page android-google-places-master.
The source code is released under:
MIT License
If you think the Android project android-google-places-master listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.a2plab.googleplaces.query; /*w w w .j a va2 s.co m*/ import android.location.Location; public class TextSearchQuery extends SearchQuery { public TextSearchQuery(String apiKey, String query, boolean sensor) { super(apiKey); setQuery(query); } /* * Set location and set required parameter "radius" to default value 2500. * * (non-Javadoc) * * @see com.a2plab.googleplaces.query.SearchQuery#setLocation(double, * double) */ public TextSearchQuery setLocation(double latitude, double longitude, int radius) { super.setLocation(latitude, longitude); setRadius(radius); return this; } /* * Set location and set required parameter "radius" to default value 2500. * * (non-Javadoc) * * @see com.a2plab.googleplaces.query.SearchQuery#setLocation(double, * double) */ @Override public TextSearchQuery setLocation(double latitude, double longitude) { super.setLocation(latitude, longitude); if (queryBuilder.getParameter("radius") == null) { setRadius(DEFAULT_RADIUS); } return this; } /* * (non-Javadoc) * * @see * com.a2plab.googleplaces.query.SearchQuery#setLocation(android.location * .Location) */ @Override public TextSearchQuery setLocation(Location location) { return this.setLocation(location.getLatitude(), location.getLongitude()); } public void setQuery(String query) { queryBuilder.addParameter("query", query); } @Override public String getUrl() { return "https://maps.googleapis.com/maps/api/place/textsearch/json?"; } }