Im new new to xamarin Android....I have an app which shows users current latitude and longitude which seems to be working...
Now, from latitude and longitude, Im trying to get address using API Geocoder. Im passing proper latitude and longitude but its not giving me any address though I cant see any error.
Following is my code :-
async Task<Address> ReverseGeocodeCurrentLocationAsync(double Latitude, double Longitude)
{
Geocoder geocoder = new Geocoder(this);
IList<Address> addressList = await
geocoder.GetFromLocationAsync(Latitude, Longitude, 10); // ???????? its not wrking....Here, Im properly able to pass latitude and longitude still issue getting adress.
IList<Address> testaddresses = await geocoder.GetFromLocationAsync(42.37419, -71.120639, 1); // ???????? i tried both sync and async method but not wrking....
Address address = addressList.FirstOrDefault();
return address;
}
// calling part Address address = await ReverseGeocodeCurrentLocationAsync(location.Latitude, location.Longitude);
Also, you can find source code at :https://github.com/4pawan/XamarinDroidSample
Please let me know what I'm doing wrong and how to rectify ?
Regards, Pawan