【问题标题】:Get contacts by group name using gdata-contacts使用 gdata-contacts 按组名获取联系人
【发布时间】:2014-01-10 20:37:10
【问题描述】:
 public static void printDateMinQueryResult(
        ContactsService myService, DateTime startTime) throws ServiceException,
        IOException
{

    URL feedUrl = new       URL("https://www.google.com/m8/feeds/contacts/liz@gmail.com/full");
    Query myQuery = new Query(feedUrl);
    myQuery.setUpdatedMin(startTime);
    myQuery.setMaxResults(Integer.MAX_VALUE);
    **myQuery.setStringCustomParameter("group" ,"Friends");**

    ContactFeed resultFeed = myService.query(myQuery, ContactFeed.class);

    System.out.println("resultFeed.getEntries().size()" + resultFeed.getEntries().size());
    for (int i = 0; i < resultFeed.getEntries().size(); i++)
    {
        ContactEntry entry = resultFeed.getEntries().get(i);
      System.out.println("\t" + entry.getTitle().getPlainText());

        for (Email email : entry.getEmailAddresses())
        {
            System.out.println(" " + email.getAddress());

       }
    }
}

这给了我所有电子邮件联系人的结果。

我想要每个组的电子邮件联系人。

例如:朋友、家人等...

所以在朋友列表中可能有 100 个电子邮件联系人和家庭 5 等等。

如何通过组名获取。

【问题讨论】:

    标签: java gdata gdata-api google-contacts-api


    【解决方案1】:

    添加这一行

    myQuery.setStringCustomParameter("group", "groupId")
    

    【讨论】:

    • 我怎么知道 groupId 。例如:我必须获取的朋友组邮件 ID 然后我必须设置的参数是什么
    • 我已经设置了 myQuery.setStringCustomParameter("group", "Friends");我无法得到联系人的结果
    猜你喜欢
    • 2015-11-10
    • 2012-08-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-25
    相关资源
    最近更新 更多