28

Are there any cons of build the facebook SDK library project into a JAR file(as ADT 16 does with library projects) and adding it to your project? I am not changing anything in the facebook SDK so don't need to have it added as a library project. So far it has been working fine for me and I am wondering whether this is a common practice used by developers using the facebook SDK? It speeds up the build process quite a bit because Eclipse doesn't have to resolve all of the resources in the library projects.

kasgoku
  • 5,057
  • 5
  • 20
  • 20

5 Answers5

13

Yes! I just figured it out myself.

You need two jar files:

  1. facebooksdk.jar
  2. android-support-v4.jar

Option 1
The first can be found in the bin folder, the latter in the Android Dependencies folder. (Of the FacebookSDK project) After adding them both as libraries to my project (Project --> properties --> Java Build Path --> Libraries) it actually worked.

Option 2
Another way is to copy paste the facebooksdk.jar and get the android-support-v4.jar via Right-click on project --> Android Tools --> Add Support Library.

Good luck =)

Knots
  • 551
  • 8
  • 19
3

Kasgoku,

The code is provided as a project for easy viewing of the classes. Adding it as an included jar or just moving the source into your project also works. When I created an FB connected android app, I moved the files I needed into a package in my app.

eosgood
  • 318
  • 1
  • 9
2

It looks like maven has them cached.

http://search.maven.org/remotecontent?filepath=com/facebook/android/facebook-android-sdk/4.4.0/facebook-android-sdk-4.4.0-sources.jar

Tom
  • 1,610
  • 1
  • 15
  • 19
0

You can create a jar file :

  1. Download Facebook Android SDK from github.
  2. Extract it. (at any location).
  3. In Eclipse create new project using create project from existing source option
  4. Enter the project name as "com_facebook_android".
  5. Set Location to "facebook" folder in extracted location.
  6. Click Finish.
  7. Select the "com_facebook_android" project in project explorer and right click select export option.
  8. In the export wizard select JAR file in Java folder.
  9. Click next then browse the location for jar file and give the name as yor wish like "facebook-android.jar"
  10. Click finish........ JAR file will be created in that location
Tobia Zambon
  • 7,479
  • 3
  • 37
  • 69
0

Well guys you dont need to manually make a .jar file out of facebook-android-sdk. You can use easyfacebook.jar. It currently supports:

  1. Oauth 2.0 authentication support
  2. Use the access token
  3. Pictures upload support
  4. Supports all the features of Graph API
  5. It can run any query FQL
  6. Contains BEAN of all facebook objects
  7. It's free. LGPL GNU license
  8. Progress dialog
  9. Logout function
  10. Server/Request Error Management
  11. Key hash/Geo Tagging
  12. Login without facebook app
Illegal Argument
  • 10,090
  • 2
  • 44
  • 61