Get persian information from android Geocoder
Asked Answered
A

2

7

I'm trying to get Persian information from android Geocoder, i mean i pass latitude and longitude and i want to get name of the city in Persian, but there is no locale to get those info in Persian. I can see that in Place Autocomplete google suggests location names in Persian, but there's no locale to set for the Geocoder. Does anybody know a way to get those info in Persian?

Attitude answered 27/1, 2017 at 22:25 Comment(1)
Check if its implemented: The Geocoder query methods will return an empty list if there no backend service in the platform. Use the isPresent() method to determine whether a Geocoder implementation exists. Alternatively look at Google Places API: developers.google.com/places/android-apiSeale
B
13

Pass your desire locale in constructor:

Geocoder geo = new Geocoder(getActivity(), new Locale("fa"));
Barlow answered 28/1, 2017 at 5:6 Comment(0)
B
0

Update : for geocoding package :

 List<Placemark> _placemarks = 
     await placemarkFromCoordinates(
         latitude,
         longitude,
         localeIdentifier: "fa-IR"
     );
Bwana answered 28/8, 2021 at 9:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.