【问题标题】:Why does GphotoEntry work but PhotoEntry returns empty value in Picasa Web Albums API?为什么 GphotoEntry 有效,但 PhotoEntry 在 Picasa 网络相册 API 中返回空值?
【发布时间】:2013-06-26 11:24:57
【问题描述】:

我的问题与 simplei 的 here 完全相同。看来他从来没有得到回答,我在这个网站上找不到这个问题,所以我想我会把它放在这个社区面前。

无论出于何种原因,GphotoEntry 都能正常工作,但 PhotoEntry 什么也不返回。我需要在 PhotoEntry 上使用 getMediaSource() 方法;它不适用于 GphotoEntry。

这是我的代码(它必须在 try-catch 语句中,但我已在此处取出)。你会注意到我已经注释掉了对我有用的行:

URL baseSearchUrl = new URL("https://picasaweb.google.com/data/feed/api/all");

Query myQuery = new Query(baseSearchUrl);
myQuery.setStringCustomParameter("kind", "photo");
myQuery.setMaxResults(10);
myQuery.setFullTextQuery("puppy");

AlbumFeed searchResultsFeed = myService.query(myQuery, AlbumFeed.class);

//for (GphotoEntry photo : searchResultsFeed.getEntries()) {
for (PhotoEntry photo : searchResultsFeed.getPhotoEntries()) {
     System.out.println(photo.getTitle().getPlainText());
}

感谢您的帮助

【问题讨论】:

    标签: java picasa


    【解决方案1】:

    我遇到了同样的问题。

    解决方案: 将photos-meta.jar 添加到类路径后,它应该可以工作。

    Here is information source

    【讨论】:

      【解决方案2】:

      对于Android,你应该使用GPhoto,对于Java,你可以使用PhotoEntry或AlbumEntry。

      也许 Google 会更新 Picasa 网络相册 API 的新版本, 所以这里有很多新的类,GPhoto 是第一个。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-10-06
        • 1970-01-01
        • 2015-02-05
        • 2014-10-05
        • 1970-01-01
        • 2011-06-01
        • 1970-01-01
        • 2013-09-24
        相关资源
        最近更新 更多