I need to know how many contacts I have in each group.
Not found in the documentation something about it, so I created this:
private Integer numberOfContacts(String groupID) {
try {
URL feedURL = new URL("http://www.google.com/m8/feeds/
contacts/" + currentUser+ "/full");
Query query = new Query(feedURL);
query.setMaxResults(20000);
query.setStringCustomParameter("group", groupID);
ContactFeed resultado = service.query(query,
ContactFeed.class);
List<ContactEntry> listaContatos = resultado.getEntries();
return listaContatos.size();
} catch (MalformedURLException e) {
throw new RuntimeException("URL inválida", e);
} catch (IOException e) {
throw new RuntimeException("Erro geral de I/O", e);
} catch (ServiceException e) {
throw new RuntimeException("Erro interno do serviço", e);
}
}
When running the query is returned group contacts, and then I return
only the number of contacts. I noticed some slow (+ 30 seconds) to get
the answer.
is there any alternative to get the number of stories of a group?
--
You received this message because you are subscribed to the Google
Groups "Google Contacts, Shared Contacts and User Profiles APIs" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://code.google.com/apis/contacts/community/forum.html