地理codeR"超时等待来自服务器&QUOT响应;地理、服务器、codeR、QUOT

2023-09-06 14:34:44 作者:清风与鹿

我试着去的纬度和经度,以转换不会忽略。当我使用WIFI即时得到正确的answer.But当我尝试将其与3G / LTE即时得到错误:

Im trying to convert the latitude and longtitude to Adresses. When I use the WIFI Im getting the right answer.But when I try it with 3G/LTE Im getting the error:

超时等待服务器的响应。

Timed out waiting for response from server.

我发现这与调试Mode.But为什么呢?即时通讯使用相同的信息(纬度,经度)。我该如何解决?我的继承人功能:

I found this with the Debug Mode.But why ? Im using the same Information (Lat,Long). How can I fix it ? Heres my Function :

public void convert_adresses (double lat , double lng) throws IOException
{
    addresses = geocoder.getFromLocation(lat, lng, 1);


    address = addresses.get(0).getAddressLine(0);
    city = addresses.get(0).getAddressLine(1);
    country = addresses.get(0).getAddressLine(2);

    txt_street.setText(address);
    txt_city.setText(city);
    txt_country.setText(country);

}

和林调用它是这样的:

try {
            convert_adresses(latitude,longtitude);
        } catch (IOException e) {
            e.printStackTrace();
}

有人得到了一个主意?

Someone got a Idea ?

推荐答案

我不知道天气预报..可能的问题是与UR网络供应商...

I'm not sure about GEOcoding.. May be problem is with ur network provider...

尝试从设备打开以下网址,并检查是否乌拉圭回合获得所需的输出通过WiFi连接

Try opening the following URL from the device and check whether ur getting the desired output as connected through wifi

https://maps.googleapis.com/maps/api/geo$c$c/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA