Tutorial by Examples

Add below dependencies to your build.gradle // Facebook login compile 'com.facebook.android:facebook-android-sdk:4.21.1' Add below helper class to your utility package: /** * Created by Andy * An utility for Facebook */ public class FacebookSignInHelper { private static final...
If you want to retrieve the details of a user's Facebook profile, you need to set permissions for the same: loginButton = (LoginButton)findViewById(R.id.login_button); loginButton.setReadPermissions(Arrays.asList("email", "user_about_me")); You can keep adding more permiss...
Once you first add the Facebook login/signup, the button looks something like: Most of the times, it doesn't match with the design-specs of your app. And here's how you can customize it: <FrameLayout android:layout_below="@+id/no_network_bar" android:id="@+id/FrameLay...
You have to setup the prerequisites. Add the Facebook activity to the AndroidManifest.xml file: <activity android:name="com.facebook.FacebookActivity" android:configChanges= "keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:theme=&...
Facebook SDK 4.0 onwards, this is how we logout: com.facebook.login.LoginManager.getInstance().logOut(); For versions before 4.0, the logging out is gone by explicitly clearing the access token: Session session = Session.getActiveSession(); session.closeAndClearTokenInformation();

Page 1 of 1