I am developing a mobile social TV application on Android.I want to integrate Facebook with my application so that I can:
The Facebook SDK for Android gives you access to the following features: Facebook Login — A secure and convenient way for people to log into your app or website by using their Facebook credentials. Sharing — Enable people to post to Facebook from your app. People can share, send a message, and share to stories.
Downloading SDK and integrating it Once imported, right click on your facebook project and click on properties. Click on android, click on add button and select facebook sdk as the project. Click ok.
The Facebook SDK is a set of software components that developers can include in their mobile app to understand how people use the app, run optimized marketing campaigns and enable Facebook login and social sharing. This course helps you understand the purpose of the Facebook SDK and App Events for Android and iOS.
This example demonstrates about How to integrate facebook in Android App Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 – Please follow Q21 to integrate Facebook. Step 3 − Add the following code to res/layout/activity_main.xml.
API Integration Setup. 1 Step 1: Create a Developer App. Go to Facebook for developers and click My Apps > Create App. You can also use an existing app. 2 Step 2: Create a System User. 3 Step 3: Assign Assets. 4 Step 4: Generate a System User Access Token. 5 Step 5: Generate a Page Access Token. More items
Now you can import com.facebook.FacebookSdk into your app. Add your Facebook App ID and Client Token to your project's strings file and update your Android manifest: 1. Open your /app/res/values/strings.xml file.
Now you can import com.facebook.FacebookSdk into your app. Add your Facebook App ID and Client Token to your project's strings file and update your Android manifest: 1. Open your /app/res/values/strings.xml file. 2. Add a string element with the name attribute facebook_app_id and value as your Facebook App ID to the file. For example 3.
You may use this.
Facebook Android SDK
But carefull about handling activity result. If you test integration in simulator you haven't installed facebook app. and sdk will show you a dialog with webview. But on a real phone if facebook app. is installed, authorization will go via app.
you need to install an extension, similar to the core Android SDK, but no, here is what you need to do:
1.) go to https://github.com/facebook/facebook-android-sdk
2.) download the facebook directory ONLY! The other directories are only examples.
3.) Put the files from the src (you can copy the drawables too, if you want to) in the package, you are currently working with
4.) You are good to go, you can use the facebook "SDK"
see also these examples https://github.com/facebook/facebook-android-sdk/tree/master/samples , it is working example provided by facebook
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With