title: how to implement facebook login in android correctly
body: <p>I want to implement the facebook api to fetch data of the user when said user clicks on the facebook login button. that's it, click.. go grab the json file and return it.</p>
  
  <p>the problem is that the developers guide are somewhat difficult to follow for me and the tutorials and posts and stuff i've found are very old and use deprecated code.. so i'm stuck
  what i've managed to code is:</p>
  
  <p>Layout:</p>
  
  <pre><code>   &lt;com.facebook.widget.LoginButton
              xmlns:fb="http://schemas.android.com/apk/res-auto"
              android:id="@+id/login_button"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_gravity="center_horizontal"
              fb:login_text="@string/registrarse_con_facebook" /&gt;    
  </code></pre>
  
  <p>java:</p>
  
  <pre><code> //global variable
   LoginButton btnRegisterFb;
  
   .
   .
   @Override
   protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_register_user);
  
  
      btnRegisterFb   = (LoginButton)findViewById(R.id.login_button);
  
      //permissions is an array of strings with permissions needed
      btnRegisterFb.setReadPermissions(Arrays.asList(FacebookHelper.permissions));
  
  
  }
  </code></pre>
  
  <p>i would love some guidance with this topic. </p>
  
  <p>how can i display the login dialog?, how can i fetch user data?</p>