我的Google地图活动使用Google Maps Geocoding API V3搜索地址.
我有时会看到,即使我按顺序多次重复搜索,当我连接数据连接时,Google地图的响应也是OVER_QUERY_LIMIT.
在应用程序安装到设备上后,它也会在第一次搜索时发生.
当我与wifi连接时,它完美无缺.
这是我的代码.
搜索方式:
public static JSONObject getAddressInfo(String sAddress) {
HttpGet httpGet = new HttpGet("http://maps.google.com/maps/api/geocode/json?address=" + sAddress + "®ion=it&language=it&sensor=false");
HttpClient client = new DefaultHttpClient();
HttpResponse response;
StringBuilder stringBuilder = new StringBuilder();
try {
response = client.execute(httpGet);
HttpEntity entity = response.getEntity();
InputStream stream = entity.getContent();
int b;
while ((b = stream.read()) != -1) {
stringBuilder.append((char) b);
}
} catch (ClientProtocolException e) {
} catch (IOException e) {
}
JSONObject jsonObject = new JSONObject(); …Run Code Online (Sandbox Code Playgroud)