Code example for Geocoder

Methods: getFromLocationgetFromLocationName

0
 
		return Service.START_NOT_STICKY;
	}; 
	 
	public String getCity(String streetAddress) throws IOException {
		Geocoder geocoder = new Geocoder(this, Locale.ENGLISH);
 
		List<Address> locations = null;
 
		locations = geocoder.getFromLocationName(streetAddress, 10);
 
		double lat = locations.get(0).getLatitude();
		double lng = locations.get(0).getLongitude();
 
		List<Address> myList;
 
		myList = geocoder.getFromLocation(lat, lng, 1);
 
		// A VÁROSNÉVVEL VALÓ VISSZATÉRÉS AZ IDÕJÁRÁS ELKÉRÉSÉHEZ 
 
		if (myList.get(0).getLocality() != null)
			return myList.get(0).getLocality();
Connect your IDE to all the code out there  Get Codota for Java