Reputation: 241
Is it possible currently to get the Google profile picture and paint it in an ImageView
? I've been looking for posts that talk about this but I have not managed to find it.
Upvotes: 1
Views: 3194
Reputation: 10093
geting google plus profile pic without using google api key
http://picasaweb.google.com/data/entry/api/user/any_name?alt=json
and after that you can grab img url in json and remove 's64-c' part from the url and append "?sz=100" parameter (100 or lager size)
Upvotes: 3
Reputation: 788
I think what you need to do is authenticate and use one of the Google+ OAuth scopes (I think it would be plus.login), to get the profile picture url: https://developers.google.com/+/api/oauth#scopes
You can use the GoogleApiClient for this. Have a look into the documentation. Or take a look into the link in the comments of your question https://developer.android.com/reference/com/google/android/gms/common/api/GoogleApiClient.html
After that you can use a library like Picasso to load the image from the URL into the ImageView: http://square.github.io/picasso/
Picasso.with(context).load(pictureUrl).into(imageView);
Upvotes: 0