Get User Current Location name in Arabic?

Viewed 1523

I need to get the location name in arabic ,if gps enable for english i am using the following code.

        Geocoder geocoder = new Geocoder(getApplicationContext(), Locale.getDefault());

       // LogCat: Display language = English

        Log.i("Display language = ", "" + mLocale.getDisplayLanguage());

        Log.i("geocoder geocoder = ", "" + geocoder.toString());

      // Geocoder geocoder = new Geocoder(getApplicationContext(), Locale.getDefault());
        try {
            List<Address> listAddresses = geocoder.getFromLocation(latitude, longitude, 1);
            if (null != listAddresses && listAddresses.size() > 0) {
                String _Location = listAddresses.get(0).getAddressLine(0);
               // Log.i("_Location = ", "" + _Location);

                Address address = listAddresses.get(0);

                Log.i("address = ", "" + address);
                result = address.getLocality();

                Log.i("result = ", "" + result);
                // Toast.makeText(getApplicationContext(), "Your Location  NAME is -" + result , Toast.LENGTH_LONG).show();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

Address[addressLines=[ Abu Dhabi - United Arab Emirates"],feature=3rd Street,admin=Abu Dhabi,sub-admin=null,locality=Abu Dhabi,thoroughfare=3rd Street,postalCode=null,countryCode=AE,countryName=United Arab Emirates,hasLatitude=true,latitude=,hasLongitude=true,longitude=,phone=null,url=null,extras=null]

i need the locality value in arabic based on user selected language in app.

i given Locale mLocale = new Locale("ar","AE"); but it is giving country name comming arabic i need locality value in arabic.

in galaxy s7 data coming correctly based on arabic selection giving arabic data

s6 not comming it is giving english data only if i pass locale arabic also.

1 Answers
Related