简体   繁体   中英

how to upload photo to picasa web album using Data Api?

I want to upload a photo to picasa web album through from android using data api. i see this link https://developers.google.com/picasa-web/docs/2.0/developers_guide_java but this does not help me at all. can any one give an example code to upload a photo to picasa web album or other tutorial. Thanks

This is the official code sample for uploading a Image,

URL albumPostUrl = new URL("https://picasaweb.google.com/data/feed/api/user/username/albumid/albumid");

PhotoEntry myPhoto = new PhotoEntry();
myPhoto.setTitle(new PlainTextConstruct("Puppies FTW"));
myPhoto.setDescription(new PlainTextConstruct("Puppies are the greatest."));
myPhoto.setClient("myClientName");

MediaFileSource myMedia = new MediaFileSource(new File("/home/liz/puppies.jpg"), "image/jpeg");
myPhoto.setMediaSource(myMedia);

PhotoEntry returnedPhoto = myService.insert(albumPostUrl, myPhoto);

A complete example code is available here,

Connect to Picasa album from Android using OAuth2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM