Code example for Geocoder

Methods: getFromLocationName

-1
 
	private List<Address> getDestinationAddresses() throws IOException {
		List<Address> destinations = new ArrayList<Address>();
         
        Address dest1 = null;
        List<Address> destBuffer = geocoder.getFromLocationName("300 West Martin Luther King Junior Boulevard, Austin, TX", 1);
        if (destBuffer != null && destBuffer.size() > 0) {
        	dest1 = destBuffer.get(0);
        	destinations.add(dest1);
        	Log.d(TAG, "dest1: " + dest1.getAddressLine(0) + " - " + dest1.getLatitude() + ", " + dest1.getLongitude());
        } else { 
        	Log.e(TAG, "Couldn't reverse geocode dest1");
        } 
         
        Address dest2 = null;
        destBuffer = geocoder.getFromLocationName("2902 Medical Arts Street, Austin, TX", 1);
        if (destBuffer != null && destBuffer.size() > 0) {
        	dest2 = destBuffer.get(0);
        	destinations.add(dest2);
        	Log.d(TAG, "dest2: " + dest2.getAddressLine(0) + " - " + dest2.getLatitude() + ", " + dest2.getLongitude());
        } else { 
        	Log.e(TAG, "Couldn't reverse geocode dest2");
        } 
         
        Address dest3 = null;
        destBuffer = geocoder.getFromLocationName("500 North IH 35, Austin, TX", 1);
        if (destBuffer != null && destBuffer.size() > 0) {
        	dest3 = destBuffer.get(0);
        	destinations.add(dest3);
        	Log.d(TAG, "dest3: " + dest3.getAddressLine(0) + " - " + dest3.getLatitude() + ", " + dest3.getLongitude());
        } else { 
        	Log.e(TAG, "Couldn't reverse geocode dest3");
        } 
         
        Address dest4 = null;
        destBuffer = geocoder.getFromLocationName("125 East 11th Street, Austin, TX", 1);
        if (destBuffer != null && destBuffer.size() > 0) {
        	dest4 = destBuffer.get(0);
        	destinations.add(dest4);
        	Log.d(TAG, "dest4: " + dest4.getAddressLine(0) + " - " + dest4.getLatitude() + ", " + dest4.getLongitude());
        } else { 
        	Log.e(TAG, "Couldn't reverse geocode dest4");
        } 
         
        Address dest5 = null;
        destBuffer = geocoder.getFromLocationName("1308 East 4th Street, Austin, TX", 1);
        if (destBuffer != null && destBuffer.size() > 0) {
        	dest5 = destBuffer.get(0);
        	destinations.add(dest5);
        	Log.d(TAG, "dest5: " + dest5.getAddressLine(0) + " - " + dest5.getLatitude() + ", " + dest5.getLongitude());
        } else {