用哪个Google API来获取用户的名字,姓氏,图片等? [英] Which Google api to use for getting user's first name, last name, picture, etc?
本文介绍了用哪个Google API来获取用户的名字,姓氏,图片等?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有oauth授权,谷歌正常工作,并从联系人API获取数据。现在,我想以编程方式获取gmail用户的名字,姓氏和图片。我可以使用哪一个google api来获取这些数据?
解决方案
我在联系人API论坛中找到答案。当你得到结果饲料时,只需在Java中进行以下操作 -
String Name = resultFeed.getAuthors()。get 0).getName();
String emailId = resultFeed.getId();
我仍在寻找获取用户个人资料图片的方法。
I have the oauth authorization with google working correctly and am getting data from the contacts api. Now, I want to programmatically get a gmail user's first name, last name and picture. Which google api can i use to get this data?
解决方案
I found the answer while looking around in the contacts API forum. When you get the result-feed, just do the following in Java-
String Name = resultFeed.getAuthors().get(0).getName();
String emailId = resultFeed.getId();
I am still looking for a way to get the user profile picture.
这篇关于用哪个Google API来获取用户的名字,姓氏,图片等?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文