We determine the address by coordinates:
double latitude = 37.7749; // любые данные double longitude = -122.4194; // любые данные
...
Geocoder geocoder; List<Address> addresses; geocoder = new Geocoder(this, Locale.getDefault()); addresses = geocoder.getFromLocation(latitude, longitude, 1); String address = addresses.get(0).getAddressLine(0);
We put a marker on our coordinates and show the resulting address:
Uri gmmIntentUri = Uri.parse("geo:" + latitude + ", " + latitude + "?q=" + Uri.encode(address)); Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri); mapIntent.setPackage("com.google.android.apps.maps"); startActivity(mapIntent);
Using googlemaps here is a great guide.