Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Geocoder.getFromLocation() returns addresses in arabic

Im using Geocoder on Android devices from Israel. Up until a few weeks ago everything worked fine and when i was doing reverse geocoding all addresses were received in hebrew. But at some point i started getting the same addresses in arabic.

This is a sample code im running (the lat/lon is in Tel-Aviv) :

Geocoder geocoder = new Geocoder(mContext, Locale.getDefault());
List<Address> addresses = geocoder.getFromLocation(32.087765863162346, 34.781454205513, 1);

When i inspect 'addresses' i get the following printout :

[Address[addressLines=[0:"عمنوئيل هرومي 26",1:"Tel Aviv",2:"Israel"],feature=26,admin=null,sub-admin=null,locality=Tel Aviv,thoroughfare=عمنوئيل هرومي,postalCode=null,countryCode=IL,countryName=Israel,hasLatitude=true,latitude=32.0877767,hasLongitude=true,longitude=34.7813859,phone=null,url=null,extras=null]]

Please note that the devices are not localized to israel. meaning, Locale.getDefault() has "US" and "en" as country and language codes.

I already opened a bug in the Geocoder issue tracker - http://code.google.com/p/gmaps-api-issues/issues/detail?id=6182 - but was referred to the Android issue tracker. Opened another one over there - https://code.google.com/p/android/issues/detail?id=64382 - but it seems like the bug is not even in the android device side but in the Geocoder backend service. So im in a dead end.

I'd appreciate if anybody that knows anybody that knows someone from the responsible team in Google will let them know. Thanks.

EDIT: since i sense that questions posted here that are not exactly formed as questions are not very appreciated, let me rephrase - Does anyone know an issue tracker where its possible to open an issue regarding the android Geocoder backend service ? Again, thanks.

like image 229
AsafK Avatar asked Jan 05 '14 21:01

AsafK


1 Answers

I had the same problem and I fixed it by setting a Locale in the Geocoder init, you can do something like this:

Locale lHebrew = new Locale("he");
Geocoder geocoder = new Geocoder(this, lHebrew);

Let me know if the problem has been solved.

like image 145
Woody Avatar answered Oct 20 '22 21:10

Woody