0
votes

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

1
do you have this permission <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> - Kun
you added internet permission? - Fabian
@Fabian i said it was working earlier.. and yes i hv added all the permissions - Nidhin Prathap

1 Answers