This project is not actively maintained. Proceed at your own risk!
Sample apps to support How To documentation found in the Android Dev Center.
Authors: Bear Douglas (beardouglas), Christine Abernathy (caabernathy), Ravi Grover (fbgrover)
Installing the samples requires you to add the Facebook SDK library to the project. To run the samples and use Facebook Login via Facebook for Android app, you also need to create your own Facebook App, set up your Android Key Hash in the Facebook App's Android settings and also use that App's ID instead of the one shipped in the samples.
-
Set up a Facebook app using the App Dashboard:
- Create a new Facebook app
- Configure the Native Android App settings.
- Enable the Facebook Login setting.
- Enter you app's signature in the Key Hash field. For more information see the Getting Started with the Facebook Android SDK.
-
Download the Facebook Android SDK 3.0.b for Android: https://developers.facebook.com/android-beta/
-
Install the Facebook Android SDK 3.0.b for Android: See the Getting Started with the Facebook Android SDK for more instructions.
-
Install the Facebook app if testing on an emulator. See the Getting Started with the Facebook Android SDK for more instructions.
-
Launch Eclipse
-
Import a sample app:
- From the Eclipse menu, navigate to File > Import
- Select General > Existing Projects into Workspace
- The sample package should include a folder for the sample you're interested in, ex: LoginHowTo
- Browse to the sample folder and select it
- Click Finish
-
Include the Facebook SDK for Android:
- From the Eclipse Package Explorer, select the sample project
- Right-click and select the Properties menu
- In the Library section, click Add
- Select FacebookSDK
- Click OK
- Click OK to exit the Properties dialog
-
Set up your Facebook App ID:
-
From the Eclipse Package Explorer, select the sample project
-
Open up the Android string resources file (res/values/strings.xml)
-
Change the existing app_id string, ex:
<string name="app_id">230430833746494</string>
to:
<string name="app_id">YOUR_APP_ID</string>
-
-
Run the application as an Android Application.
The How Tos are listed in the technical guide setion in https://developers.facebook.com/android-beta/
Facebook SDK for Android documentation can be found at https://developers.facebook.com/android-beta/
All contributors must agree to and sign the Facebook CLA prior to submitting Pull Requests. We cannot accept Pull Requests until this document is signed and submitted.