Google places query limit-Collection of common programming errors
I think you exceed the usage of the google map API. If you exceed the usage of the google map API the response status code will be OVER_QUERY_LIMIT I assume you doing as same as this
protected void onPostExecute(String file_url) {
// dismiss the dialog after getting all products
pDialog.dismiss();
// updating UI from Background Thread
runOnUiThread(new Runnable() {
public void run() {
/**
* Updating parsed Places into LISTVIEW
* */
// Get json response status
String status = nearPlaces.status;
// Check for all possible status
if(status.equals("OK")){
// Successfully got places details
if (nearPlaces.results != null) {
// loop through each place
for (Place p : nearPlaces.results) {
HashMap map = new HashMap();
// Place reference won't display in listview - it will be hidden
// Place reference is used to get "place full details"
map.put(KEY_REFERENCE, p.reference);
// Place name
map.put(KEY_NAME, p.name);
// adding HashMap to ArrayList
placesListItems.add(map);
}
// list adapter
ListAdapter adapter = new SimpleAdapter(MainActivity.this, placesListItems,
R.layout.list_item,
new String[] { KEY_REFERENCE, KEY_NAME}, new int[] {
R.id.reference, R.id.name });
// Adding data into listview
lv.setAdapter(adapter);
}
}
else if(status.equals("ZERO_RESULTS")){
// Zero results found
alert.showAlertDialog(MainActivity.this, "Near Places",
"Sorry no places found. Try to change the types of places",
false);
}
else if(status.equals("UNKNOWN_ERROR"))
{
alert.showAlertDialog(MainActivity.this, "Places Error",
"Sorry unknown error occured.",
false);
}
else if(status.equals("OVER_QUERY_LIMIT"))
{
alert.showAlertDialog(MainActivity.this, "Places Error",
"Sorry query limit to google places is reached",
false);
}
else if(status.equals("REQUEST_DENIED"))
{
alert.showAlertDialog(MainActivity.this, "Places Error",
"Sorry error occured. Request is denied",
false);
}
else if(status.equals("INVALID_REQUEST"))
{
alert.showAlertDialog(MainActivity.this, "Places Error",
"Sorry error occured. Invalid Request",
false);
}
else
{
alert.showAlertDialog(MainActivity.this, "Places Error",
"Sorry error occured.",
false);
}
}
});
}
as you can see in this sample code by Android Hive will get response from google places API and check it after that and if the status is OVER_QUERY_LIMIT the error will be shown is “Places Error Sorry query limit to google places is reached”. You can see it in this section
else if(status.equals("OVER_QUERY_LIMIT"))
{
alert.showAlertDialog(MainActivity.this, "Places Error",
"Sorry query limit to google places is reached",
false);
}
You can exceed the Google Maps API Web Services usage limits by:
Sending too many requests per day. Sending requests too fast, i.e. too many requests per second. Sending requests too fast for too long or otherwise abusing the web service. Exceeding other usage limits, e.g. points per request in the Elevation API.
the above problems can be address by combining two approaches:
Lowering usage, by optimizing applications to use the web services more efficiently. Increasing usage limits, when possible, by purchasing additional allowance for your Maps API for Business license.
for more information you can see it here-> Google Places API
if you have any question please feel free to ask in the comment 🙂