Here is the code to retrieve the contact list that is only emails ...
i really dont know how to return the first name or full of the emails retrieve..
public static void printDateMinQueryResults(ContactsService myService) {
try {
System.out.println("ddqq");
// Create query and submit a request
// URL feedUrl1 = new
// URL("
http://www.google.com/m8/feeds/contacts/rac...@gmail.com/full");
URL feedUrl = new URL(
"
https://www.google.com/m8/feeds/contacts/default/full");
Query myQuery = new Query(feedUrl);
// myQuery.setUpdatedMin(startTime);
myQuery.setMaxResults(999999);
ContactFeed resultFeed = myService
.query(myQuery, ContactFeed.class);
System.out.println("****" + resultFeed.getTitle().getPlainText());
List<ContactEntry> entry = resultFeed.getEntries();
for (ContactEntry ce : entry) {
Name dd = ce.getName();
if (dd != null) {
System.out.println(dd.getFullName().getValue());
}
final List<Email> ee = ce.getEmailAddresses();
final List<Im> mm = ce.getImAddresses();
for (Im bl : mm) {
System.out.println("---> " + bl.getAddress());
}
for (Email ss : ee) {
System.out.println("==>" + ss.getAddress());
}
}
// // Print the results
// System.out.println(resultFeed.getTitle().getPlainText() +
// " contacts updated on or after "
// + startTime);
// for (int i = 0; i < resultFeed.getEntries().size(); i++) {
// ContactEntry entry = resultFeed.getEntries().get(i);
// // We assume existence of a nameToPrintableString function that
// formats
// // the Name of a contact into a string suitable for printing.
// List<Email> ee=entry.getEmailAddresses();
// for(Email ss : ee) {
// System.out.println("==>"+ss.getAddress());
// }
// System.out.println("\t" + entry.getName());
//
// }
} catch (ServiceException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();