我如何通过 google 人 api 获取 android 中的其他联系人

How can i get other contacts in android by using google people api

我仔细阅读了 people api https://developers.google.com/people/v1/other-contacts 的文档。他们已经提供了函数 otherContacts() 但在 PeopleService 中不可用 class

ListOtherContactsResponse response = peopleService.otherContacts().list()
.setReadMask("metadata,names,emailAddresses")
.execute();

List<Person> otherContacts = response.getOtherContacts();

尝试使用此代码但未在 PeopleService 中找到 ListOtherContactsResponse class 和 otherContacts()。我正在使用这些依赖项

compile 'com.google.api-client:google-api-client-android:1.23.0'
compile 'com.google.oauth-client:google-oauth-client-jetty:1.23.0'
compile 'com.google.apis:google-api-services-people:v1-rev277-1.23.0'

com.google.apis:google-api-services-people:v1-rev20200720-1.30.10 这个版本终于解决了我的问题