Вы можете использовать ниже метод:
// get latlng from address
public LatLng getLocationFromAddress(String strAddress) {
Geocoder coder = new Geocoder(context, Locale.getDefault());
List<Address> address;
LatLng p1 = null;
try {
address = coder.getFromLocationName(strAddress, 5);
if (address == null) {
return null;
}
Address location = address.get(0);
location.getLatitude();
location.getLongitude();
p1 = new LatLng(location.getLatitude(), location.getLongitude());
return p1;
} catch (Exception e) {
e.printStackTrace();
}
return p1;
}
Пожалуйста, пост код, который вы пробовали до сих пор. – Tauqir