How to find Longitude and Latitude of Particular location?
the location is entered by user in edittext & click on search button then the location is display in googlemap.
i used following code for that but this is give error "Service not Available"
Geocoder geoCoder = new Geocoder(this, Locale.getDefault()); try { address=geoCoder.getFromLocationName(txtlocation.getText().toString(), 1).get(0); double longi=address.getLongitude(); double latit=address.getLatitude(); System.out.println("longitude:--- " +longi); System.out.println("latitude:---" +latit); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); Toast.makeText(MapRouteActivity.this, e.toString(), Toast.LENGTH_LONG).show(); }