Professional Documents
Culture Documents
Unit 5
Unit 5
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set the layout file as the content view.
setContentView(R.layout.activity_main);
{
ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},
PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);
return;
}
Task<Location> locationResult = fusedLocationProviderClient.getLastLocation();
locationResult.addOnSuccessListener(this, new
OnSuccessListener<Location>() {
@Override
public void onSuccess(Location location) {
// Got last known location. In some rare situations this can be null.
if (location != null) {
lastKnownLocation=location;
map.moveCamera(CameraUpdateFactory.newLatLngZoom(
new LatLng(lastKnownLocation.getLatitude(),
lastKnownLocation.getLongitude()), DEFAULT_ZOOM));
}
}
});
Geocoding
Geocoding is the process of transforming a street address
or other description of a location into a (latitude,
longitude) coordinate.
Reverse geocoding is the process of transforming a
(latitude, longitude) coordinate into a (partial) address.
The amount of detail in a reverse geocoded location
description may vary, for example one might contain the
full street address of the closest building, while another
might contain only a city name and postal code.
Geocoding is the process of converting addresses (like a street
address e.g. "1600 Pennsylvania Avenue NW") into geographic
coordinates (like latitude and longitude- e.g., 38.8811111,-
77.036871).
This can be helpful for many things, including:
Recognizing geographical patterns
Analyzing customer data
Verifying customer addresses
Planning retail locations