Search code examples
androidfacebookfacebook-android-sdkandroid-library

Referencing the Facebook SDK in my Android project


I'm trying to reference the Facebook SDK to my existing Android project. I've been going through the given tutorial in the Facebook site. So here's what I've done:

  1. I copied the Facebook SDK folder to my workspace.
  2. Went to Project->Properties->Android
  3. Set the "Is Library" radio button to true and pressed on the "ADD" button.

But I don't see in the popping dialog anything, it's just blank, no SDK.

What am I missing here?

Here's the workspace folder, and the Facebook SDK folder is located in it:

link

And here's the Android Properties. As you can see there's no Facebook SDK there. It's just blank:

link


Solution

  • So here's what you've done:

    1. Copied the Facebook SDK folder to my workspace.
    2. Went to Project -> Properties -> Android
    3. Set the "Is Library" radio button to true and pressed on the "ADD" button.

    Well, you are not supposed to do the Steps 2 and 3. The Facebook SDK is already coded to be a library project and you just need a reference to it in your existing application. Hence, the ADD button should be pressed in the existing project and it should reference the Facebook SDK.

    Here is what you need to do :

    1. Go the website and get the contents by using git or just zip everything using the ZIP button

    2. Put the Facebook SDK folder in your workspace (no need to select it "Is Library" )

    3. Select your Existing Android Project
    4. Right Click -> Properties -> Android
    5. In the Library section, click on Add (by doing this step you are adding a reference to the Facebook SDK in your existing application)
    6. Select Facebook SDK there

      You are good to go!