相关疑难解决方法(0)

谷歌地图地理编码API V3使用wifi搜索确定,但通过数据连接响应OVER_QUERY_LIMIT

我的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 + "&region=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)

android android-maps google-geocoding-api

2
推荐指数
1
解决办法
2413
查看次数