Posts

Showing posts with the label LoginButton Facebook

How to do Facebook Login with Custom Button Android

In my previous Facebook Post( http://androidammy.blogspot.in/2015/07/facebooklogin1.html ). I write how to use Facebook default button to login with Facebook. In this blog I am writing about how we can use facebook login functionality from android widget like Button/TextView/ImageView. All the steps are same as last facebook login post. This blog describe that  how to create instance of CallBackManager and LoginManager and how to call Login from click listener. 1.  Create Instance of LoginManager and CallbackManager. com . facebook . login . LoginManager fbLoginManager ; fbLoginManager = com . facebook . login . LoginManager . getInstance (); CallbackManager callbackManager = CallbackManager . Factory . create (); mFbLoginManager . registerCallback ( callbackManager , new FacebookCallback < LoginResult >() { @Override public void onSuccess ( LoginResult loginResult ) { // here w...

Facebook Login Using LoginButton

Image
Facebook SDK give two classes in Android to Login through Facebook 1. LoginButton class which provides UI of Login button and maintain the Login and Logout session. 2. LoginManager class which provides initiate login without using UI element. In This tutorial we will use LoginButton class. Below Step by Step process to Facebook Login using LoginButton.  1. Open Facebook Developer Account . 2. Go to MyApps and click on Add new app then the below pop-up window opened. 3. Select Android from above popup. The below window opened.  4. Type your app name (App name must not be contain word 'face' in it) and press skip quick start button. The below window opened. 5. Open Android Studio and create a project. 6. Now open app level gradle and add the below dependency. compile ' com . facebook . android : facebook - android - sdk: 4.4 . 0 ' 7. Open xml file and Add LoginButton into xml like below. <com.facebook.login.widget.LoginButton ...