public PhotoList < Photo > getContactsPhotos ( int count , boolean justFriends , boolean singlePhoto , boolean includeSelf ) throws FlickrException { PhotoList < Photo > photos = new PhotoList < Photo > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_CONTACTS_PHOTOS ) ; if ( count > 0 ) { parameters . put ( "count" , Integer . toString ( count ) ) ; } if ( justFriends ) { parameters . put ( "just_friends" , "1" ) ; } if ( singlePhoto ) { parameters . put ( "single_photo" , "1" ) ; } if ( includeSelf ) { parameters . put ( "include_self" , "1" ) ; } Response response = transport . get ( transport . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } Element photosElement = response . getPayload ( ) ; NodeList photoNodes = photosElement . getElementsByTagName ( "photo" ) ; photos . setPage ( "1" ) ; photos . setPages ( "1" ) ; photos . setPerPage ( "" + photoNodes . getLength ( ) ) ; photos . setTotal ( "" + photoNodes . getLength ( ) ) ; for ( int i = 0 ; i < photoNodes . getLength ( ) ; i ++ ) { Element photoElement = ( Element ) photoNodes . item ( i ) ; photos . add ( PhotoUtils . createPhoto ( photoElement ) ) ; } return photos ; }
Get photos from the user s contacts .