Geocoder gc = new Geocoder(this);
try {
List<Address> foundAdresses = gc.getFromLocationName(addressInput, 5); //Search addresses
for (int i = 0; i < foundAdresses.size(); ++i) {
//Save results as Longitude and Latitude
//@todo: if more than one result, then show a select-list
Address x = foundAdresses.get(i);
double lat = x.getLatitude();
double lon = x.getLongitude();
Log.v("lat",""+lat);
Log.v("lon",""+lon);
}
}
catch (Exception e) {
Log.v("err",e.toString());
}
above code i am using for get latitude and longitude by providing location name once it is working fine.
now it is showing error like **Java.io.IOException:unable to parse response from server**
can u please help me.if you have any code for getting latitude and longitude by provideing location address post for me