How to oAuth with Facebook4j on Android - 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!

Related

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

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.

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.

How to implement user login with Google, Facebook or Twitter in Android app?

I am trying to implement user login via social networks to my app. User should login with their google, facebook or twiter account to the app and create content that will later be sent/or synced to the app rest service.
What is the best way to do this?
I was successful with adding google and facebook sign in button and getting auth tokens from them but then i started reading on some tutorials that include account manager which is needed to implement sync adapter for data that needs to be synced with server, but as i understood i need to create my own login and add new user implementation for this to work?
Can i use social login with sync adapter, or do i need to implement my own account management?
Please point me in the right direction.
I personally avoid tutorials that "help" you to build a customized social API's interface, first because they could rely on old API version (take Facebook for example, their graph API authentication system has changed a lot through years), second because they could propose a solution that is not what you are really looking for.
Instead, why don't you simply follow the official tutorials from Facebook SDK page (https://developers.facebook.com/docs/android/scrumptious/), Google and so on?

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.

More advanced android facebook example

I'm having some problems with facebook integration on my android app. I've looked at the examples that come with the api and i can do the things shown in those ok. But i'm having problems with other things such as getting single sign on to work properly, authentication across multiple activities in the app and loading a facebook page (non-api call) without being asked to log in again.
Anyone have examples that show these?
When making API calls, you usually need to include the access_token parameter that was issued when the user authenticated. This is how facebook knows who you are when you make requests.
Similarly, when loading facebook pages (not using the API), you have to remember to send the cookies Facebook sent when the user logged in. Normally the browser keeps track of these automatically, but in your program or app you might have to handle them manually.
I don't have experience with Android specifically, and I don't know what you're using to load and render facebook pages, but knowing how facebook is keeping track of logged-in users should give you an idea of where to start. A google search or two should get you on your way.
Go to facebook.java class and change package name com.facebook.katana to com.facebook.katanaaa or any one of your own choice. This worked for me .

Categories

Resources