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.
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)
http://lh6.ggpht.com/-gAabIEudGQw/AAAAAAAAAAI/AAAAAAAAAAA/n062zUtBx4k/s64-c/101417311204099987701.jpg
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);
Related
What I want is:
share a local image to my fb wall without native fb app installed (not using fb sdk).
What I have tried:
I'm ok with share url image, status ...
I tried many threads related to this api: /me/feed, /me/photos/ and also with various kind of fields: picture, source, method=photos.upload...
But it seems that fb changed the way to upload byteArray image through POST or I missed something. Please help me to clarify that professors.
I reference to this document:
https://developers.facebook.com/docs/graph-api/photo-uploads
In this doc, they said that:
To specify a photo you can use two methods:
Provide the URL for the photo with the url parameter
Provide a file with the POST request* (how can I do that?)
I found the solution, by using those classes:
LoginManager: request "publish_actions" and get accessToken
GraphRequest: pass the accessToken to "/me/feed"
ShareApi: share content normally as ShareDialog
I am using google cloud storage for storing profile images for one of the android app which we are developing. I am able to store images to the cloud properly..I want to set the same image to imageview in my application using picasso API.
It is saying Access denied, When I share Image on cloud publicly, it is setting image to Imageview, otherwise not...
How could I give these public share through android application for user to set images using Picasso?
Thank you in advance
When you upload the image you must make sure (assuming you don't want authentication) the ACL is set to publicRead.
The upload in java looks like this:
storage.objects()
.insert(BUCKET_NAME, null, content)
.setName(fileName)
.setPredefinedAcl("publicRead")
.setKey(API_KEY)
.execute();
For setting the ACL manually in the developers console tick the "shared publicly" check box.
The url then looks like this:
http://storage.googleapis.com//
Good luck.
How can i post message along with Picture using Facebook SDK 3.0 on Android,
The link -> can post small pic with link and all other information.
http://developers.facebook.com/docs/howtos/androidsdk/3.0/feed-dialog/
What i want, is only to post Pic on wall with message, not a link with description ?
I want grab screen shot of my current Android screen that i did and saved it into SD card, i need to post it with message on custom button click.
How can i do this with Facebook SDK 3.0 for android ?
You can use the Graph API to post photos to a user's wall.
See the reference page for more details.
In the Facebook SDK, you would use the Request class to make Graph API calls.
You can use the newUploadPhotoRequest method to add a photo.
If you want to add a description as well, try setting the "message" parameter:
Request photoRequest = Request.newUploadPhotoRequest(...);
Bundle params = photoRequest.getParameters();
params.putString("message", "description goes here");
photoRequest.executeAsync();
Facebook changed this implementation for there version 2 Graph API requests, they recommend a Custom Story instead of posting (if you have your own content to put on the wall of the facebook user beside his comment, or even without his comment)
documentation goes here :
https://developers.facebook.com/docs/android/open-graph?locale=en_GB
just an error in the documentation, the facebook Open Graph objects are refered to by a colon, and not a dot, for example
they mention an open graph Object named "book" in a work space named "books" that way
"books.book"
the correct way is
"books:book"
and after you finish implementation you will need to review your application to facebook, which it's documentation goes here as well
https://developers.facebook.com/docs/apps/review?locale=en_GB
i really hate facebook documentation, it sucks
At present i am struggling to post a comment to a photo on facebook wall .
Can any one direct me the graph-api for posting comment to the facebook photo?
Thanks
So, if you want to publish something, you need to use POST request for facebook-graph-api.
Facebook has a graph structure, so, each thing has connections to other things.
You need to post a message to photo. Ok.
If you have an access_token, you can you POST-request for Graph-API.
OK, after all things, just create an URL for request: https://graph.facebook.com/PHOTO_ID/comments?message=MESSAGE&access_token=ACCESS_TOKEN and use POST:
POST https://graph.facebook.com/PHOTO_ID/comments?message=MESSAGE&access_token=ACCESS_TOKEN
See more information in Publishing section
Adding the icon
You can manage icons from your app's dashboard: https://developers.facebook.com/apps/APP_ID/appdetails
I want to upload a foto from my android app to a facebook fan page using the facebook API.
When i look in the hackbook android example app (link). the code looks as following to a upload photo:
Bundle params = new params.putString("url",
"http://www.facebook.com/images/devsite/iphone_connect_btn.jpg"); params.putString("caption",
"FbAPIs Sample App photo upload");
Utility.mAsyncRunner.request("me/photos", params,
"POST", new PhotoUploadListener(), null);
This code works, it posts the photo on my own facebook page. But i don't want the photo to be posted on my page but on a fan page.
As explained in the facebook documentation 'me' could be changed with a facebook User_ID. I tried changing the "me/photo" in "[fanpagename]/photo" or "[fanpageID]/photo", but that did not work. when i used the username i got an error, when i used the ID it post the photo on my own page. In the graphAPI photo documentation (link) no example or explanation is givin on how to upload a foto on fan page.
also the
params.putString("to", [fbid]);
does not work.
Any suggestions?
I have been busy with this research for three full days and did not find the answer for my problem. But i think i have an explanation for it.
if a user posts a photo to friend/fan_page with the official android FB app it uses a "feed" with a picture(url-link). The user can't see on his own wall that he actually shared or posted a picture on the friend/fan_page. (for example: "Bob - posted a photo on CocaCola")
This is probably the reason why the function is disabled because developers could use this to send photo's to all kinds of friends/fan_pages without the user being aware of it.
I came to this hypotheses because i found a sort of work around. First upload the photo to users own album. get the URL of that photo and then post a "feed" on the friend/fan_page with a picture(url-lnk). Facebook then gave this error: "FBCDN image is not allowed in stream" in other words, you can't use photos that are on FB website domain to link to. So I think there is quite a bug/lazyness in the facebook developement departmet :P which is a pity because it is a nice socialnetworking function for mobile apps.
You are on the right track, but to publish photos to a Page you will need the publish_stream and manage_pages permissions, and the Page Access Token to prove you have them. You can read more about this here:
http://developers.facebook.com/docs/reference/api/page/#photos
http://developers.facebook.com/docs/reference/api/page/#page_access_tokens
Some example code (using the PHP SDK, but the logic should be the same in any language) is here: https://stackoverflow.com/a/7222078/164439
Update:
If you want to post to the Page's Wall/Feed (without being a Page Admin), you can do that without the Manage Pages permission and the Access Token stuff.
But it's different than publishing a Photo object to the Page's Photos collection, which is what I thought you asked. You actually want to do a regular Post to the Page, with a Picture attachment.
Here are some resources to do this:
Facebook Post API: http://developers.facebook.com/docs/reference/api/post/
http://facebook.stackoverflow.com/questions/691425/how-do-you-post-to-the-wall-on-a-facebook-page-not-profile
http://facebook.stackoverflow.com/questions/5756474/post-to-facebook-page-wall
Using Facebook Graph to simply post a wall message with just javascript
Good luck!