I downloaded the android's facebook sdk but so far I couldn't configure properly. Eclipse doesn't recognize the facebook sdk as a project.
Does anyone got this problem?
The current version of the Facebook SDK for Android is version 14.1. 0 and requires the Android API 15. Code and samples for the Facebook SDK for Android are available on GitHub.
Go to your Facebook App --> Settings--> Paste Hash key in "key hashes" option -->save changes. Now Test your android app with Facebook Log-in/Share etc.
You should use the git plugin to import the facebook project from github into your eclipse workspace. It's configured as an android library. And then in your android project in which you want to use the library. Right click on the project and choose properties. Click on the Android tab, and at the bottom should be a section for libraries, detailed instructions here. Click Add, and the facebook sdk should appear. Check the facebook sdk and it will then be available in your app.
Facebook SDK integration into an android application should be easy, but there are some caveats to take care of during the first integration steps, so follow it carefully:
Download the SDK from git hub - This could be done using a github client, but an easier way is to simply download the zipped version by pressing the "zip" button as appears in the following snapshot.
Extract the zip file - make sure to extract it into a folder that is not within the eclipse workspace. In the next step you will need to create a project in eclipse based on this zip, but sometimes, putting the extracted zip directly into the workspace confuses eclipse, so avoid putting it there. Put it somewhere else.
Open Eclipse and create a new Android Project (File -> New -> Project -> Android Project) for the Facebook Android SDK source. (On the next step you will add it as a reference library to your app). Create the project by selecting "Create project from existing source" and specify the facebook-sdk folder into which you extracted the zip. (note: if you want it to be stored in the workspace itself, you can always "import" the project into the workspace later on)
Add it as a project library to your app by selection the current project (of your app) -> properties, and add the facebook project as a library to your current project.
later steps include adding permissions to the Android Manifest such as uses-permission android:name="android.permission.INTERNET"/>
and then adding your application ID into the code. I will skip the details here as it is quite straight forward.
following steps are for creating facbook-android.jar (use this jar file in your any project)
Step1: Download Facebook Android SDK from github.
Step2: Extract it. (at any location).
Step3: In Eclipse create new project using create project from existing source option
Step4: Enter the project name as "com_facebook_android".
Step5: Set Location to "facebook" folder in extracted location.
Step6: Click Finish.
Step7: Select the "com_facebook_android" project in project explorer and right click
select export option.
Step8: In the export wizard select JAR file in Java folder.
Step9: Click next then browse the location for jar file and give the name as yor wish like "facebook-android.jar"
Step10: Click finish........ JAR file will be created in that location
This is not correct process, you should use facebook-android project as library project, because resource files will not import to your project while you are using .jar file
jar file is only for Java Projects not for Android Project, Some of jar files may work but not all..
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