2

I really searched for days to find a good tutorial to import the facebook sdk to make a simpel login system. if the facebook sdk work with the login then I can go on to import contacts and so on. but everytime I try to import it (tryed like 20 different things) it gave me errors. I just need a simple explenation for how I get the facebook sdk in android studio.

robbie demaegdt
  • 33
  • 1
  • 1
  • 4
  • what are the errors? Here is a [sample project](https://github.com/sromku/android-simple-facebook) related with all `Facebook` action in android – hrskrs Feb 05 '15 at 11:42
  • http://stackoverflow.com/questions/19961828/using-facebook-sdk-in-android-studio – A.S. Feb 05 '15 at 11:44
  • add dependency in build.gradle like this : dependencies { compile 'com.facebook.android:facebook-android-sdk:3.22.0' } – Karan Maru Feb 05 '15 at 11:44
  • that you for the sample app, I gonna take a look at it. I have already saw that stackoverflow post and didn't work for me also with de dependencies I hate a few errors. – robbie demaegdt Feb 05 '15 at 16:46

2 Answers2

5

make sure you have done the following:

first you have to add the following to the dependencies in your app gradle:

compile 'com.facebook.android:facebook-android-sdk:3.21.1'

In your AndroidManifest.xml you have to include the facebook login activity like so :

    <activity
        android:name="com.facebook.LoginActivity"
        android:label="@string/app_name" />
    <activity

also in the app manifest you have to include your app id as a meta-data tag :

  <meta-data
        android:name="com.facebook.sdk.ApplicationId"
        android:value="@string/app_id" /> //Create a string resource with your app id

then you can follow this video which is quiet straight forward :

Facebook Official Android SDK Installation Video

J.Vassallo
  • 2,282
  • 3
  • 15
  • 14
  • thank you, it works for me but in the video they let run the facebook inlog on the oncreate but when I try to put the hole session.openactivesession in a button setonclicklistener is doesn't pop up, when I debug it the request.newMeRequest will not execute. [Valid XHTML](http://i61.tinypic.com/28v7ncz.png). that is a image of my onClickListener. – robbie demaegdt Feb 06 '15 at 09:19
  • What are you using the SDK for? Login? Posts? Graph search? – J.Vassallo Feb 06 '15 at 09:57
  • first I try to just login but later in my project I need the permissions to share things, acces to the friendlist, profile photo, public information from people. – robbie demaegdt Feb 06 '15 at 10:12
  • Just not to feel sry about it later first be advised that you can access friends information of only people that installed your app...since the policy change of facebook. Just to make sure you know were you are heading....I will hit office soon and have some code I can share with you about loging in..using graph etc – J.Vassallo Feb 06 '15 at 10:19
  • I just need the friendlist of people so they can challenge each other in sporting. that would be a great help for me, I'm a student so I have a lot to learn about programming android. the video is working for me, just trying now to login on a button click. – robbie demaegdt Feb 06 '15 at 10:27
  • You can do that now only if the user's friends installed your app...you cannot access all friends...very sad indeed – J.Vassallo Feb 06 '15 at 10:30
  • ow that is a disadvantage for programmers that wanna use facebook, I go looking for include other social media and maybe with email invitations – robbie demaegdt Feb 06 '15 at 10:39
  • http://stackoverflow.com/questions/23417356/facebook-graph-api-v2-0-me-friends-returns-empty-or-only-friends-who-also-u – J.Vassallo Feb 06 '15 at 10:43
  • I am back with a question. if I run my program on my cellphone it works, but when I try it on a tablet that it says "app not setup: the developers of this app have not set up this app properly for facebook login" but on the tablet there is a other standard facebook profile (not the one that is programming the app) – robbie demaegdt Feb 12 '15 at 11:07
  • hi!...i posted a new answer for this issue – J.Vassallo Feb 12 '15 at 14:18
0

For the error "app not setup: the developers of this app have not set up this app properly for facebook login"

Go to your facebook developer app page..click status and review..and enable to the general public

enter image description here

and then

enter image description here

J.Vassallo
  • 2,282
  • 3
  • 15
  • 14