Reputation: 2702
i am developing application in which i want to use geocoding ,but when i using goecode
List<Address> addresses = geocoder.getFromLocation(12.33,102.44, 1);
if (addresses != null && addresses.size() > 0) {
Address address = addresses.get(0);
// sending back first address line and locality
result = address.getAddressLine(0) + ", " + address.getLocality();
Toast.makeText(this, result,Toast.LENGTH_SHORT);
Logcat showing ioexception as follows
12-17 11:50:55.367: WARN/System.err(339): java.io.IOException: Service not Available
12-17 11:50:55.377: WARN/System.err(339): at android.location.Geocoder.getFromLocation(Geocoder.java:136)
i have no android device,so i want to check this in emulator,how can resolve the problem?
Upvotes: 1
Views: 1282
Reputation: 21
reverse geocodeing getFromLocation method works fine when you build avd with the target as Google API 19 and also build the application target with the Google API 19.
Upvotes: 1
Reputation: 109247
If you are using android 2.2 then It's a bug in the emulator for 2.2 http://code.google.com/p/android/issues/detail?id=8816
It seems to me that this is a problem with the emulator... The getFromLocationName method seems to work just fine on the devices..
Upvotes: 2