How to implement that when you press the button to get your place position. Coordinates and street address.
Maybe there are articles or examples on this topic?
Probably need to use Yandex. Maps.
for this there are different services. and Yandex and Google.
use geocoder
Geocoder geocoder; List<Address> addresses; geocoder = new Geocoder(this, Locale.getDefault()); addresses = geocoder.getFromLocation(latitude, longitude, 1); // Где 1 это максимальное количество резултат для этой координат, по документу советуется использовать 1 до 5 String address = addresses.get(0).getAddressLine(0); // Если есть еще другие адреса, используйте это String city = addresses.get(0).getLocality(); String state = addresses.get(0).getAdminArea(); String country = addresses.get(0).getCountryName(); String postalCode = addresses.get(0).getPostalCode(); String knownName = addresses.get(0).getFeatureName(); // Если есть даст результат, если нет NULL
try using different sites like
coding in anroid
Source: https://ru.stackoverflow.com/questions/506705/
All Articles