madProgrammer
madProgrammer

Reputation: 43

Android Create Google Contact Through Google People Api

I am new at Google People API. I am able to fetch contacts through api, but I couldnt figure out how to create contacts. As api documantation says I need to use this code block;

Person contactToCreate = new Person();
List names = new ArrayList<>();
names.add(new Name().setGivenName("John").setFamilyName("Doe"));
contactToCreate.setNames(names);
Person createdContact = peopleService.people().createContact(contactToCreate).execute();

But createContact is giving "Cannot resolve method 'createContact(com.google.api.services.people.v1.model.Person)' " error. How can I solve this problem ? Or are there another ways to create Google Contact ?

Upvotes: 0

Views: 520

Answers (1)

Amos Yuen
Amos Yuen

Reputation: 1459

There was a bug with the automatic java client library code generation. The bug has been resolved and the latest version 125 has the contact endpoints. Follow the instructions at https://developers.google.com/people/v1/libraries to install the latest library.

Upvotes: 1

Related Questions