My current problem is that my APP requires being able to locate certain places using the Google Maps api , of which I do not know their longitude and latitude, but I do know their route or address (example: street/sector/point). Currently I don't own a code as such, only the examples that the Documentation offers . Which consists of a simple method which locates a point by its latitude + longitude, and a title.
public class MapsMarkerActivity extends AppCompatActivity
implements OnMapReadyCallback {
// Include the OnCreate() method here too, as described above.
@Override
public void onMapReady(GoogleMap googleMap) {
// Add a marker in Sydney, Australia,
// and move the map's camera to the same location.
LatLng sydney = new LatLng(-33.852, 151.211);
googleMap.addMarker(new MarkerOptions().position(sydney)
.title("Marker in Sydney"));
googleMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
}
}
Thank you and I look forward to your soon support.
You can use the Geocoder class
This is an example looking for an address, in this case I define Street, sector, State and Country (
"Tepeji 22, Roma, Mexico City, CDMX"
).:This returns the latitude and longitude of the description: