Get private photos using flickrj-android -
i using open source library: https://code.google.com/p/flickrj-android/ , there example how photos flickr. main problem public photos. how can manage getting private streams/photos? did managed private streams?
with flickrj-android you'd want use method:
flickr flickr = new flickr(api_key,shared_secret,new rest()); set<string> extras = new hashset(); // set of info want flickr give back. go api page see other size options available. extras.add("url_o"); extras.add("original_format"); //a request list of photos in set. first 0 privacy filter, // second pages, , third per-page (see flickr api) photolist<photo> photolist = flickr.getphotosetsinterface().getphotos(photoset_id, extras, 0, 0, 0); //we'll use direct url original size of photo in order download it. remember: want make few requests flickr possible! for(photo photo : photolist){ //you can other sizes. ask info in first request. url url = new url(photo.getoriginalsize().getsource()); inputstream = url.openstream(); outputstream os = new fileoutputstream(path_of_folder + photo.gettitle() + "." + photo.getoriginalformat()); byte[] b = new byte[2048]; int length; while ((length = is.read(b)) != -1) { os.write(b, 0, length); } is.close(); os.close(); }
use method single-photo inputstream.
inputstream inputstream = flickr.getphotosinterface().getimageasstream(flickr.getphotosinterface().getphoto(photo_id), size.original);
Comments
Post a Comment