У нас вы можете посмотреть бесплатно How to convert Latitude and Longitude location to an actual address and show on map in Android App? или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
This video shows the steps to to get the location details such address, area, locality, city, state and country details from the latitude and longitude information. To get the information it uses Geocoder's API getFromLocation. It uses the App created in one of the previous videos as a starting point. Previous video can be watched using the below link. It is strongly recommended to watch this video before referring to the current video: • How to track your location using GPS and s... The previous App's layout is modified by adding a button and Text Boxes to get the Latitude and Longitude information from the user and display the result in the text view. We will be glad to hear from you regarding any query, suggestions or appreciations at: [email protected] https://programmerworld.co/android/ho... Complete Source Code: package com.example.myyoutubelocationapp; public class MapsActivity extends FragmentActivity implements OnMapReadyCallback { private GoogleMap mMap; private LocationManager locationManager; private LocationListener locationListener; private final long MIN_TIME = 1000; private final long MIN_DIST = 5; private LatLng latLng; private TextView textView; private EditText editTextLat; private EditText editTextLong; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_maps); // Obtain the SupportMapFragment and get notified when the map is ready to be used. SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); mapFragment.getMapAsync(this); ActivityCompat.requestPermissions(this,new String[]{Manifest.permission.SEND_SMS}, PackageManager.PERMISSION_GRANTED); ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, PackageManager.PERMISSION_GRANTED); ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.INTERNET}, PackageManager.PERMISSION_GRANTED); textView = findViewById(R.id.textView); editTextLat = findViewById(R.id.editTextLat); editTextLong = findViewById(R.id.editTextong); latLng = new LatLng(-34, 151); } public void getLocationDetails(View view){ double latitude = latLng.latitude; double longitude = latLng.longitude; if (!(editTextLong.getText().toString().isEmpty() || editTextLat.getText().toString().isEmpty())) { latitude = Double.parseDouble(editTextLat.getText().toString()); longitude = Double.parseDouble(editTextLong.getText().toString()); latLng = new LatLng(latitude, longitude); } Geocoder geocoder; List(Address) addresses; geocoder = new Geocoder(this, Locale.getDefault()); String address = null; String city = null; String state = null; String country = null; String postalCode = null; String knonName = null; try { addresses = geocoder.getFromLocation(latitude, longitude, 1); address = addresses.get(0).getAddressLine(0); city = addresses.get(0).getLocality(); state = addresses.get(0).getAdminArea(); country = addresses.get(0).getCountryName(); postalCode = addresses.get(0).getPostalCode(); knonName = addresses.get(0).getFeatureName(); } catch (IOException e) { e.printStackTrace(); } mMap.addMarker(new MarkerOptions().position(latLng).title("Marker in : " + address + city + state + country + postalCode + knonName)); mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng)); textView.setText(address + city + state + country + postalCode + knonName); } }