Here's my entire source code (for Android). I don't know what I am doing 
wrong.

public class MainActivity extends Activity {

PicasawebService service;
 @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
service = new PicasawebService("test");
new Thread() {
@Override public void run() {
try {
String uname = "em...@gmail.com";
String password = "(password)";
service.setUserCredentials(uname, password);
URL feedUrl = new 
URL("https://picasaweb.google.com/data/feed/api/user/default?kind=album";);
Query albumQuery = new Query(feedUrl);
UserFeed myUserFeed = service.getFeed(feedUrl, UserFeed.class);
for (AlbumEntry entry : myUserFeed.getAlbumEntries()) {
Log.v("test", entry.getGphotoId() + ":" + entry.getTitle().getPlainText() );
Log.v("test", entry.getGphotoId() + ":" + entry.getSummary().getPlainText() 
);
}
for (GphotoEntry entry : myUserFeed.getEntries()) {
Log.v("test", entry.getGphotoId() + ":" + entry.getTitle().getPlainText() );
Log.v("test", entry.getGphotoId() + ":" + entry.getSummary().getPlainText() 
);
}
} catch (AuthenticationException e) {
Log.e("test", "auth fail");
}
catch (IOException e) {
Log.e("test", "There was a problem communicating with the service.");
}
catch (ServiceException e) {
Log.e("test", "The server had a problem handling your request.");
}
catch (Exception e) {
Log.e("test", "Unkwown error");
}
}
}.start();
}

The result is #1~#3 I mentioned above.
Please help.

Thank you.


On Tuesday, January 8, 2013 6:11:00 PM UTC-5, Joshua Park wrote:
>
> Hi Mike,
>
> I have the same problem: myUserFeed.getAlbumEntries() returns 0 entries 
> where myUserFeed.getEntries() returns the correct number of Albums but they 
> are GphotoEntry(not AlbumEntry).
> I am using Version 2.0 libraries on Android.
>
> I added :
> gdata-base-1.0.jar
> gdata-client-1.0.jar
> gdata-client-meta-1.0.jar
> gdata-core-1.0.jar
> gdata-docs-3.0.jar
> gdata-docs-meta-3.0.jar
> gdata-media-1.0.jar
> gdata-photos-2.0.jar
> gdata-photos-meta-2.0.jar
> activation.jar
> mail.jar
> servlet-api.jar
> guava-jdk5-13.0.jar
>
> libraries.
>
> -------------------
> So:
>
> #1: It doesn't print anything
> for (AlbumEntry entry : myUserFeed.getAlbumEntries()) {
> Log.v("test", entry.getGphotoId() + ":" + entry.getTitle().getPlainText() 
> );
> Log.v("test", entry.getGphotoId() + ":" + 
> entry.getSummary().getPlainText() );
> }
>
> #2: It prints album info (but they are not AlbumEntry)
> for (GphotoEntry entry : myUserFeed.getEntries()) {
> Log.v("test", entry.getGphotoId() + ":" + entry.getTitle().getPlainText() 
> );
> Log.v("test", entry.getGphotoId() + ":" + 
> entry.getSummary().getPlainText() );
> }
> #3: It prints album info (but they are not AlbumEntry)
> Query albumQuery = new Query(feedUrl);
> AlbumFeed feed = service.query(albumQuery, AlbumFeed.class);
> for (GphotoEntry entry : feed.getEntries()) {
> Log.v("test", entry.getGphotoId() + ":" + entry.getTitle().getPlainText() 
> );
> Log.v("test", entry.getGphotoId() + ":" + 
> entry.getSummary().getPlainText() );
> }
>
>
> On Tuesday, September 18, 2012 5:45:35 PM UTC-4, Mike Erickson wrote:
>>
>> Okay, I put together a working test file with a new set of client 
>> libraries downloaded. I was able to successfully print album titles like 
>> this:
>>
>> URL feedUrl = new URL("
>> https://picasaweb.google.com/data/feed/api/user/default?kind=album";);
>>     UserFeed userFeed = myService.getFeed(feedUrl, UserFeed.class);
>>
>>     for (AlbumEntry albumEntry : userFeed.getAlbumEntries()) {
>>       System.out.println(albumEntry.getTitle().getPlainText());
>>     }
>>
>> Ralph, the problem for you might be that you are calling 
>> UserFeed.getEntries() instead of UserFeed.getAlbumEntries() which is 
>> returning a base class instead of the AlbumEntry class the way you were 
>> expecting.
>>
>> Let me know if you have more trouble here.
>>
>> Thanks,
>> -m.e.
>>
>> On Tuesday, September 18, 2012 10:26:54 AM UTC-7, Mike Erickson wrote:
>>>
>>> Hi Ralph,
>>>
>>> I'm sorry this isn't working for you. I'll try to find a solution, 
>>> although nothing immediately comes to mind. If I can duplicate the issue, 
>>> then I can help fix it. .
>>>
>>> Thank you,
>>> -Mike
>>>
>>> On Tuesday, September 18, 2012 4:29:52 AM UTC-7, Ralph wrote:
>>>>
>>>> Hi,
>>>>
>>>> I also cannot get this working correctly. I have the following JARs in 
>>>> my classpath:
>>>>
>>>> - gdata-base.jar
>>>> - gdata-core.jar
>>>> - gdata-client.jar
>>>> - gdata-client-meta.jar
>>>> - gdata-photos.jar
>>>> - gdata-photos-meta.jar
>>>>
>>>> Despite all this, when I call UserFeed.getEntries() I just get a list 
>>>> of GphotoEntry objects that are _not_ instances of AlbumEntry. The entry 
>>>> titles, however, do correspond to the titles of my albums. I'm using the 
>>>> API from a Google App Engine servlet by the way, not a client 
>>>> application. It looks like there's been a lot of silence regarding this 
>>>> topic and I also noticed that a lot of related questions on this forum do 
>>>> not get any answers. I hope somebody can reply so we can get this working. 
>>>> I'm planning on using the Picasa API for a commercial web application so 
>>>> it's quite important for me :)
>>>>
>>>> Greetz,
>>>>
>>>> Ralph
>>>>
>>>>
>>>> On Monday, August 27, 2012 11:27:02 AM UTC+2, 李龙涛 wrote:
>>>>>
>>>>> 在 2011年5月15日星期日UTC+8下午9时44分15秒,cremer...@gmail.com写道: 
>>>>> > Thanks! It works! 
>>>>>
>>>>> I did so, but it still does not work, someone can help me?
>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Picasa Web Albums API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-picasa-data-api/-/FE82OnMmAOsJ.
To post to this group, send email to google-picasa-data-api@googlegroups.com.
To unsubscribe from this group, send email to 
google-picasa-data-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-picasa-data-api?hl=en.

Reply via email to