The last comment (Jan 28) makes this question clear enough to answer:
- A lat,lng location is already available, that is the starting point.
- The goal is to obtain the the... a street address.
- Currently this is done using
geocoder.getFromLocation(latitute,longitude,1)
- The problem is that this method is unstable and does not work sometimes.
- The question is then: Is there anything else that I can use?
And the answer is: yes, with caveats.
First, please note that geocoder.getFromLocation()
is provided by Android, for free but without guarantees:
Warning: Geocoding services may provide no guarantees on availability or accuracy. Results are a best guess, and are not guaranteed to be meaningful or correct. Do not use this API for any safety-critical or regulatory compliance purpose.
Since your concern seems to be the reliability of this service, a better solution may be provided by the Google Maps Platform Geocoding API, which does offer certain guarantees of latency and availability, as it is one of the Google Maps Platform Core Services.
The first caveat of this solution is that it is not entirely free of charge, see here How the Geocoding API is billed and consider what the cost would be for based on your user base and how often a latlng needs to be converted to an address. Make sure to restrict your API keys and optimize your usage.
The second caveat, which you might even like, is that this API doesn't return just one address, it tends to return a few. You can try this out using the Geocoder Tool at https://developers.google.com/maps/documentation/utils/geocoder (click on the map and it will reverse geocode that point).