Facebook : Upload mutiple photos for a single post from android application - android

I have to post multiple photos to Facebook from Android application.
Can anyone help me how can I do that?
Thanks in advance.

You can download the Facebook Android SDK and integrate it into your application.
Then use this link to be able to log in the user into your Facebook application, thereby acquiring a valid access token. Make sure to ask for the publish_stream permission.
Then you have to make the appropriate graph API call to upload photos. Calling general graph API is explained here.
The method to post photos to a user's facebook is done using the /{album-id}/photos, /{user-id}/photos or directly to the user's wall through /{user-id}/feed. The appropriate endpoints are listed out here.
It would also help if you show what progress you have made in your attempt so far, but because it was a general question, this is a fairly general answer.

Related

is "publish_action" permission necessary to post on facebook wall through android applicaton?

I just need to post some text and Image on the Facebook wall of my app's user.
The Facebook app registered in developers.facebook.com doesn't have "publish_actions" permission by default. I already have submitted request for this permission but its taking long to get approved.
Meanwhile seeing my friend doing this post operation thorugh ios app without this "publish_action" permission I am curious do i need this permission to post some text and image on users wall at all? Please help me..
You dont, if you are using open graph:
Reference: The Share dialog lets people publish stories from your app without Facebook Login or the publish_actions permission. However you still have to send your app for review.
The best part is that a user can tag people in a post built upon graph API. As a sample app I would suggest you check how Scrumptious works, it comes prepackaged in the FB SDK.
You can check this link: Android: How to share image with text on facebook via intent?
Use intent sharing for normal text and image post
Publishing
You can publish posts by using the /{user-id}/feed, /{page-id}/feed,
/{event-id}/feed, or /{group-id}/feed edges.
When creating a Post for a Page if you use a user access token the
post will be in the voice of the user that posted it. If you use a
page access token, the post will be in the voice of the page.
Source.
Upload Photos to a User's Profile
This example covers uploading a photo to the current User's profile
using the Graph API and the Facebook SDK for PHP.
It assumes that you've already set your default app id and secret, and
acquired a FacebookSession using an access token or one of the login
helper classes found here. You must have requested the publish_actions
scope when logging in the user for this to work.
For more information, see the documentation for GraphObject,
FacebookRequest, and FacebookRequestException.
Source.
As you can see, you need the publish_actions privilege to post to wall a post with picture and text. You need a review as well.

How to oAuth with Facebook4j on Android

Is there a way to Login with user and password into Facebook API with Facebook4j library on Android?
I did some research, but anything clear appears:
-Some projects using a WebView to take authoritation just chrash or don't work properly.
-Using Facebook class on Facebook4j its imposible to take the access token, at least with codes i found.
Could anyone help me please?
Ok if you want to make direct calls to facebook Graph API without the third party API then you need to get
appID: create an app on developers.facebook.com for what ever purpose you need android website etc..
user access token: go to the Graph API on developers.facebook.com, select your app and click get the user access token, ensure you give the app the permissions it need in the checkboxes
use the appid, appsecret and the access token to make the post call, if you want to keep the info and post at a later time you will need a longlife/permanant token which you can retrieve with the userID and the accesstoken
Post to feed: https://developers.facebook.com/docs/graph-api/reference/v2.2/post
That is how I have done this but probably the more recommended way is to use the official Facebook Android SDK https://developers.facebook.com/docs/android
hope that helps!
Finally I found a solution. It really works, and makes all the job easier:
ASNE library
You can login on Facebook (using the official SDK) and post/retrieve some information about posts, friends, bio... It's just enough for a big chunk of apps.
Thank you ccreedon1 for your help man!

Link to login to social Media from app

In my app I want to have a link or button that can use stored credentials to login to social media sites - say facebook. But, since I plan on having a multiple links/buttons to different sites that may use different login info, I cannot force users to login to my app using any of the social media credentials.
Please forget the storing of credentials for now - that is a different issue altogether.
My question is Can I send the user's info to Facebook to allow them to login without having to take them to the login screen? If so, where to best find the information to do that?
Sorry if this is a noob question, but I am a noob to app dev and still trying to get my direction. Any sites or links with information would be appreciated.
sorry for the answer but from my experience you need to go through Facebook API to log in an android application using facebook,same for other social network. No clue what you wanted to do use a HTTP POST with the credential ?
There is a serious security issue with what you're trying to do, because it's you're application that handles the social network credential and so you would need to encrypt them store them and so on...
So if you want to give a try to Facebook Android API it's here : https://developers.facebook.com/docs/android/getting-started/
Dealing with the Facebook API is too much easy. You will follow some steps to import it into your project. Register your App on facebook developer site. Put the facebook button into your layout.
When the user clicks on the button the API will handle all the subsequent steps starting from taking the user username and password and will reply to you with a temporary accessToken that will be valid for two months. This is the only communication way with Facebook API, if you want to give the Facebook API any info with any other way. I am sorry to tell you you will not be able to do that.

Authorize app comes each time while posting tweet in android application

In my application some texts are posting in the Twitter. Each time while posting in the twitter "Authorize app" comes and user have to authorize the application each time while posting text in the twitter. I want user have to authorize the application for the first time not the each time. I have used the twitter sample code from the github. Please help me to solve the issues. Thanks.
You're better off using Twitter4j library, it's listed on the official site (has unofficial status though)
You most likely are using twitter-android-sdk which can only auth over WebView, which is very limiting.
The up-to-date way to use Twitter API is to use oAuth and Twitter4j can do that, check out the link above, it has examples.
UPD
Also, if posting to Twitter is not your app's main purpose (like you want to give the user the ability to share something but they won't be doing so 60% of the time), you're better off using an Intent broadcast to share your content - that way if user has Twitter app installed, they won't have to authorize in your app at all, more details here and here if you are targeting API14+

Using Facebook Single Sign On (or other features) without the official Facebook app

I would like to integrate Facebook into an application - enable login using Facebook credentials (Single Sign On, to login to a third-party service), and also share some wall posts.
The problem is, I don't want to depend on the installation of the official Facebook app.
I heard about some solution involving opening Facebook login from a WebView, but didn't find details.
Anyone has experience with that?
Thanks
Yes you can do it using the OAuth for getting permission, then use the Graph API to post on users walls.
Please see this link for OAuth: http://developers.facebook.com/docs/authentication/
And this link for Graph API documentation:
http://developers.facebook.com/docs/reference/api/
especially for posting http://developers.facebook.com/docs/reference/api/post/
All Facebook APIs built on the idea that you perform request from a particular application (identified by application id). So the answer is NO, you cannot perform API queries (as well as authentication) without having registered an app.

Categories

Resources