Facebook SDK for Android 4 - Authorize and Logout

mybringback · 34K views · 2012 · 9:03

Open on YouTube

Software (other)Web developmenttutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as the tutorial they followed when building Facebook login and logout into an early Android app, usually when asking why their code or SDK setup fails.

Recommended by 1 people across 1 different months, 2012 to 2014.

What it is

A 9-minute tutorial from the mybringback channel showing how to use the Facebook SDK 3/4 for Android to authorize an app with Facebook and log out. It covers wiring a button to the authorization request, writing onActivityResult to call the authorizeCallback, and adding a logout path.

What people said

Recommends user3783625 · 2014-06 · Stack Overflow · on “facebooksdk.jar missing from Android Dependencies library”

I'm trying to create my first Android app using Facebook SDK. I've been following tutorials at [this video] . Originally everything was working fine at set up/downloading Facebook SDK and it was not giving me any errors when I was writing the application. Then I tried to run the application on the emulator and I didn't see anything on it. Then, when I tried to fix this, I started to get several errors not seen in the tutorial. The current errors I'm getting are "Your project contains error(s), please fix them before running your application" and "R.java was modified manually! Reverting to generated version!" I've seen the second error before and gotten it to go away by deleting R.java and having

Cites Shoshi · 2012-11 · Stack Overflow · on “Getting error for Login and Logout using facebook SDK”

this is my MainActivity: package com.FBupdater; import java.io.IOException; import java.net.MalformedURLException; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.ImageButton; import android.widget.Toast; import com.facebook.android.DialogError; import com.facebook.android.Facebook; import com.facebook.android.Facebook.DialogListener; import com.facebook.android.FacebookError; public class MainActivity extends Activity implements OnClickListener { String APP_ID = getString(R.string.APP_ID); Facebook fb; ImageButton button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCre

Cites anuruddhika · 2014-02 · Stack Overflow · on “How to get Facebook user name in android app”

I added Facebook login function to my application. it was successfully connect and logout from the application. I want to print that login user name in my application. Can anyone help meto find this? I used This [this video] as example This is my code. fbLogin.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if(fb.isSessionValid()){ try { fb.logout(getApplicationContext()); updateButtonImage(); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }else{ fb.authorize(MainActivity.this, new String[]{"email"}, new DialogListener() { @Override pu