Code example for Address

Methods: getAddressLine, getLocality, getMaxAddressLineIndex

0
    		addresses = geocoder.getFromLocation(lat, lng, MAX_RESULTS);
		} catch (java.io.IOException e) {} 
    	if (addresses != null && addresses.size() > 0) {
            Address address = addresses.get(0);
            // get the first line of address (if available) 
            String street = address.getMaxAddressLineIndex() > 0 ? address.getAddressLine(0) : "";
            String city = address.getLocality();
            result = String.format("%s, %s", street, city);         
        } 
        return result;
    } 
     
    @Override 
    protected void onPostExecute(String address) {
        if (super.isCancelled()) { 
        	address = null;
        } 
        if (address != null && mCallback != null) {
        	mCallback.onAddressEncoded(address);
        } 
    }