Google has announced a new People API for Android to help apps gather information from your contacts list, which is meant to eventually replace the current Contacts API and move away from using Google+ to glean connections about a user. This is an interesting move compared to Google’s direction just a few years ago when the company was bent on forcing everything through the social media portion of their services, and really shows that Google has changed focus from Google+ back to multiple services, like Photos and Hangouts.
The new API gives developers an easy way to grab contacts and all of their linked connections and profiles, if a user grants permission. This API is more focused on streamlining things and keeping that info secure and private.
If you’re interested in looking over the documentation for the API or implementing it yourself, you can follow the links below to Google’s developer site.
Previously, developers had to make multiple calls to the Google+ API for user profiles and the Contacts API for contacts. The new People API uses the newest protocols and technologies and will eventually replace the Contacts API which uses the GData protocol.
For example, if your user has contacts in her private contact list, a call to the API (if she provides consent to do so) will retrieve a list containing the contacts merged with any linked profiles. If the user grants the relevant scopes, the results are returned as a people.connections.list object. Each person object in this list will have a resourceName property, which can be used to get additional data about that person with a call to people.get.
The API is built on HTTP and JSON, so any standard HTTP client can send requests to it and parse the response. However, applications need to be authorized to access the APIs so you will need to create a project on the Google Developers Console in order to get the credentials you need to access the service. All the steps to do so are here. If you’re new to the Google APIs and/or the Developers Console, check out this first in a series of videos to help you get up-to-speed.