androidgoogle-geocoderuserlocation

Android Geocoder Timeout error


UPDATE: Looks Like it is because of google map service is down for the past day See here

Im using geocoder to get user address from his lat, long. Till yesterday all was good , but today its giving me a timeout error:

Unable connect to Geocoder java.io.IOException: Timed out waiting for response from server at android.location.Geocoder.getFromLocation(Geocoder.java:136) at LocationAddress$1.run(LocationAddress.java:32)

I read at many places GeoCoder has this issue, and alternative is to use web api to get the address. Rather than doing this is there any other solution

Geocoder geocoder = new Geocoder(context, Locale.getDefault());
            String result = null;
            UserLocation u = null;
            try {
                List<Address> addressList = geocoder.getFromLocation(
                        latitude, longitude, 1);

Permissions: <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

This is what im doing with lat long.

Any fix ???????????? Thanks in advance


Solution

  • Looks like Google Geocoder is down

    https://code.google.com/p/gmaps-api-issues/issues/detail?id=9153