andytaoli / gdata-java-client-eclipse-plugin

Automatically exported from code.google.com/p/gdata-java-client-eclipse-plugin
0 stars 0 forks source link

ContactsService.getFeed() get 25 contacts only #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. in Eclipse create a new Google Data Project with the Contacts template.
2. insert your gmail username/password in a new debug configuration.
3. run it.

What is the expected output? What do you see instead?

I should get all my 57 contacts, but I get 25 of them only.

What version of the product are you using? On what operating system?

Google Data API 1.29.0
Eclipse 3.4.1
Google Data Plug-in 1.0.0
Java JDK 1.6.0-11

Please provide any additional information below.

Original issue reported on code.google.com by esorcic...@gmail.com on 11 Jan 2009 at 11:35

GoogleCodeExporter commented 8 years ago
This is not an issue. By default, you will get 25 entries in your feed. For 
further
details, refer to the NOTES at
http://code.google.com/apis/contacts/docs/2.0/developers_guide_protocol.html#ret
rieving_without_query

This says that you can override the default number of entries to be retrieved 
in the
feed from 25 to any other number using the 'max-results' as the URL query 
parameter.
Alternatively, if you do not know the size (which is usually the case), you can 
use
the <ContactFeed>.getNextLink() function to get the link to the next page i.e.
another feed with other 25 entries. One way to use it can be,

URL feedUrl = new URL(resultFeed.getNextLink().getHref());
resultFeed = myService.getFeed(feedUrl, ContactFeed.class);
List<ContactEntry> entries = resultFeed.getEntries();

You can loop this logic to get all your contacts till the 
resultFeed.GetNextLink() is
null i.e. the feed has no more pages of entries. For any questions related to 
Google
Data Contacts API, visit 
http://groups.google.com/group/google-contacts-api?pli=1.
For further details, on usage of Google Data Java Client library, you can visit
http://code.google.com/apis/gdata/client-java.html#Tutorial

Original comment by kunalmsh...@gmail.com on 14 Jan 2009 at 11:11