In my current android application, I would like to get the geocordinates based on an entered city name, street name or zip code. How can I accomplish this?
Best Rega
Try this.
Geocoder geoCoder = new Geocoder(getBaseContext(), Locale.getDefault());
try {
List addresses = geoCoder.getFromLocation(latitude , longitude, 1);
String strCompleteAddress= "";
//if (addresses.size() > 0)
//{
for (int i=0; i ", strCompleteAddress);
Toast.makeText(getBaseContext(), strCompleteAddress, Toast.LENGTH_LONG).show();
}
catch (IOException e) {
Log.i("MyLocTAG => ", "this is the exception part");
e.printStackTrace();
}