Search code examples
androidgoogle-mapsgoogle-geocoder

Android Geocoder getFromLocation returns 0 results for valid locations


The code snippet below works from most lat/lon coordinates. However, passing specific coordinates returns no results.

Geocoder geocoder = new Geocoder(HappyApp.instance(), Locale.getDefault());
Log.w(TAG, "geocoder object created and is present: " + Geocoder.isPresent());
List<Address> addresses = geocoder.getFromLocation(32.0923805, 35.165159, 1);
Log.w(TAG, "List size: " + addresses.size());

Geocoder.isPresent() returns true. List size is 0. The location can be confirmaed by typing Ari'el in Google maps. Same for Gaza (just Gaza not strip).

My question is it an issue with Android API/Google maps or am I doing something wrong? Thanks.


Solution

  • It seems that Google avoid providing Country and other data where the territory is under controversy dispute like north Cyprus and the Gaza strip.

    Whenever we get 0 results, we use the following online service: http://www.geonames.org