I'm trying to convert the latitude and longitude to address. When I use the WIFI I'm getting the right answer. But when I try it with 3G/LTE I'm getting the error:
Timed out waiting for response from server.
I found this with the Debug Mode. But why? I'm 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);
}
And Im calling it like this :
try {
convert_adresses(latitude,longtitude);
} catch (IOException e) {
e.printStackTrace();
}
Someone got a Idea ?