Is there a better way to obtain the Id of a specific ContactGroupEntry
from your gData contacts without having to retrieve and iterate through the entire List?
// contactsService has been properly initialized...
// hunting for the groupNameId corrisponding to the plaintext groupName
final URL url = new URL("http://www.google.com/m8/feeds/groups/default/full");
String groupNameId = null;
ContactGroupFeed f = contactsService.getFeed(url, ContactGroupFeed.class);
int totalResults = f.getTotalResults();
List<ContactGroupEntry> list = f.getEntries();
while (list.size() < totalResults) {
Query q = new Query(url);
q.setStartIndex(f.getStartIndex() + f.getItemsPerPage());
q.setMaxResults(200);
f = this.contactsService.query(q, ContactGroupFeed.class);
list.addAll(f.getEntries());
}
for(ContactGroupEntry g : list) {
if (groupName.compareTo(g.getPlainTextContent()) == 0) {
groupNameId = g.getId();
break;
}
}
// return groupNameId