Search code examples
javaandroidgoogle-people-api

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


I followed through the documention of people api https://developers.google.com/people/v1/other-contacts.They already provided the function otherContacts() but it is not available in PeopleService class

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

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

tried with this code but didn't find ListOtherContactsResponse class and otherContacts() in PeopleService. I am using these dependencies

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'

Solution

  • com.google.apis:google-api-services-people:v1-rev20200720-1.30.10 Finally this version solves my problem