Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用gdata联系人按组名获取联系人_Java_Gdata_Gdata Api_Google Contacts Api - Fatal编程技术网

Java 使用gdata联系人按组名获取联系人

Java 使用gdata联系人按组名获取联系人,java,gdata,gdata-api,google-contacts-api,Java,Gdata,Gdata Api,Google Contacts Api,这会给我所有电子邮件联系人的结果 我想要每个小组的电子邮件联系人 朋友、家人等 所以在freinds列表中可能有100个电子邮件联系人,在family 5中,以此类推 如何通过其组名获取信息。添加此行 public static void printDateMinQueryResult( ContactsService myService, DateTime startTime) throws ServiceException, IOException {

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

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

朋友、家人等

所以在freinds列表中可能有100个电子邮件联系人,在family 5中,以此类推

如何通过其组名获取信息。

添加此行

 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());

       }
    }
}

我怎么知道groupId呢。例如:我必须获得朋友组邮件ID,那么我必须设置的参数是什么?我已经设置了myQuery.setStringCustomParametergroup,Friends;我无法得到联系的结果
myQuery.setStringCustomParameter("group", "groupId")