Gangnaminmo Ako
Gangnaminmo Ako

Reputation: 577

Facebook SDK at Android

enter image description hereI'm following a step in this link to have an Facebook log in in my Android App http://www.androidhive.info/2012/03/android-facebook-connect-tutorial/ But my problem was when I'm Adding a reference there is no project to add and I can't use this line in my Android Java.class " private Facebook facebook;" because I can't import the type "Facebook"

Downloaded a Facebook SDK in this link https://github.com/facebook/facebook-android-sdk and I extract it. The name of the folder was "facebook-android-sdk-master" I'm tying to import the file in this way.

1.Project>import>Existing Project into Workspace> the file
2.Project>import>Archive File> the file
3.Project>import>File System> the file

and the problem was, when I'm trying to add it on my library there is nothing to add.

So I'm thinking that maybe I Downloaded a wrong Facebook SDK in github

the way that I Download the Facebook SDK was

I Clicked the ZIP Button with the Hover Text "Download this repository as zip file"

Can anyone point my mistake? because I'm having a real Bad time with this.

Thanks any thoughts will be highly appreciated.

This is my problem I don't have any project to add in my reference even if I already import the facebook SDK that I download in github

Upvotes: 1

Views: 505

Answers (3)

Chandrashekhar
Chandrashekhar

Reputation: 498

Does you downloaded package contain Facebook etc classes in the src folder then this the correct sdk u have downloaded. What u have to do is import this project and then in the project properties in android section check the is a library option that will make it a library project. Now in the project u want to use this u can add this project to the libraries again by going to the project properties.

If still u cant do it just copy and paste the classes from the main src folder of the facebook sdk in your projects src folder there will be few errors of the drawable fix them by placing the corresponding drawable file in your drawable directory and then u will be able to use the Facebook class from within your project. For your convenience place it in a separate package.

Upvotes: 1

ductran
ductran

Reputation: 10193

I faced with the same issue. This way worked for me: just go to File -> New Project -> choose Android project from Existing code, then press next, input the path facebook sdk and press enter, if facebook project doesn't below, try press refresh button. It should like image below:

enter image description here

enter image description here

Upvotes: 1

cfeduke
cfeduke

Reputation: 23226

You'll need to use Eclipse to create a project from existing source > "facebook-android-sdk/facebook"

This generates the .project directory and other necessities for Eclipse. You can do this step in a separate instance of Eclipse and close it when you're done.

Now in your original project you should be able to then import the newly created project into your workspace and finally add a reference to it from your project.

Upvotes: 0

Related Questions