Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In order to acces the facebook graph api you'll need to use their SDK. You can download it from here <a href="https://github.com/facebook/facebook-android-sdk" rel="nofollow">https://github.com/facebook/facebook-android-sdk</a>. They provide you with a dialog box for the user to enter their user and password and obtain an oauth token. Then using the Facebook object you can request anything on the graph path API. As with the example they give you can use something similar to show the login dialog.</p> <pre><code>package com.greatap; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import com.facebook.android.*; import com.facebook.android.Facebook.*; public class MyGreatActivity extends Activity { Facebook facebook = new Facebook("YOUR_APP_ID"); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); facebook.authorize(this, new DialogListener() { @Override public void onComplete(Bundle values) {} @Override public void onFacebookError(FacebookError error) {} @Override public void onError(DialogError e) {} @Override public void onCancel() {} }); } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); facebook.authorizeCallback(requestCode, resultCode, data); } } </code></pre> <p>Your friends list can be accessed using the graph path of /me/friends. </p> <pre><code>facebook.request("me/friends"); </code></pre> <p>This should return something that looks like the following</p> <pre><code> { "data": [ { "name": "Fake", "id": "11111" }, { "name": "Fake fakerson", "id": "111111" }, { "name": "So Fake", "id": "111111111" } ]} </code></pre> <p>You can then access each user using their id and the open graph api to retrieve their email if it's visible to you.</p> <pre><code>fakebook.request("/111111111"); </code></pre> <p>This will give you back a json array that contains your friends IDs. You can then cycle through each of the friends and retrieve their information if it's available to you. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload