Code example for Address

Methods: getLatitude, getLongitude, toString

0
 
        try { 
            List<Address> addresses = geoCoder.getFromLocationName(
                    locationName,1);
            for (Address addr : addresses) {
                Log.d(TAG_NAME, addr.toString());
 
                GeoPoint geoPoint = new GeoPoint(
                        (int) (addr.getLatitude() * Math.pow(10, 6)),
                        (int) (addr.getLongitude() * Math.pow(10, 6)));
 
                return geoPoint;
                 
            } 
        } catch (IOException e) {
            Log.e(TAG_NAME, "error getting address from geocoder. " + e);
        } 
        return null; 
    }