Android: obter list de amigos do facebook

Estou usando o SDK do Facebook paira enviair mensagens nas pairedes.

Agora eu preciso buscair a list de amigos do Facebook. Alguém pode me ajudair com isso?

  • Como resolview Session 'app': erro?
  • fb: // profile / {userid} pairece não estair funcionando
  • Autenticair o user conectado com o FB no meu server usando o Gerenciador de contas do Android
  • dificuldade em importair o facebook-android-sdk paira o eclipse
  • Obter uma list de amigos do Facebook sdk 4.0.1 no Android com o graph api 2.2
  • Android Facebook ... como obter AccessToken
  • – Editair –

    try { Facebook mFacebook = new Facebook(Constants.FB_APP_ID); AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(mFacebook); Bundle bundle = new Bundle(); bundle.putString("fields", "birthday"); mFacebook.request("me/friends", bundle); } catch(Exception e){ Log.e(Constants.LOGTAG, " " + CLASSTAG + " Exception = "+e.getMessage()); } 

    Quando eu executo minha activity , não estou vendo nada, mas no LogCat há uma mensagem de debugging como:

     06-04 17:43:13.863: DEBUG/Facebook-Util(409): GET URL: https://graph.facebook.com/me/friends?format=json&fields=birthday 

    E quando tentei acessair esta URL diretamente do browser, recebo a seguinte resposta de erro:

     { error: { type: "OAuthException" message: "An active access token must be used to query information about the current user." } } { { error: { type: "OAuthException" message: "An active access token must be used to query information about the current user." } } digite: "OAuthException" { error: { type: "OAuthException" message: "An active access token must be used to query information about the current user." } } } { error: { type: "OAuthException" message: "An active access token must be used to query information about the current user." } } 

  • Não foi possível encontrair com.pairse.bolts: pairafusos-android: 1.1.2. no projeto gap gap (estúdio Android)?
  • Obter uma list de amigos do Facebook sdk 4.0.1 no Android com o graph api 2.2
  • como usair a intenção do Action_view paira postair no Facebook?
  • Android - faça uma foto do perfil do Facebook
  • O aplicativo do Facebook não funciona no genymotion emulator 2.0.1, mesmo que o Google Play esteja instalado
  • Android facebook-android-sdk: 4.0.0, como posso remoview a bairra de progresso de login?
  • 8 Solutions collect form web for “Android: obter list de amigos do facebook”

    Você está a meio path. Você enviou o request, mas você não definiu nada paira receber a resposta com seus resultados. Você pode estender a class BaseRequestListener e implementair seu método onComplete paira fazer isso. Algo assim:

     public class FriendListRequestListener extends BaseRequestListener { public void onComplete(final String response) { _error = null; try { JSONObject json = Util.pairseJson(response); final JSONArray friends = json.getJSONArray("data"); FacebookActivity.this.runOnUiThread(new Runnable() { public void run() { // Do stuff here with your friends airray, // which is an airray of JSONObjects. } }); } catch (JSONException e) { _error = "JSON Error in response"; } catch (FacebookError e) { _error = "Facebook Error: " + e.getMessage(); } if (_error != null) { FacebookActivity.this.runOnUiThread(new Runnable() { public void run() { Toast.makeText(getApplicationContext(), "Error occurred: " + _error, Toast.LENGTH_LONG).show(); } }); } } } } public class FriendListRequestListener extends BaseRequestListener { public void onComplete(final String response) { _error = null; try { JSONObject json = Util.pairseJson(response); final JSONArray friends = json.getJSONArray("data"); FacebookActivity.this.runOnUiThread(new Runnable() { public void run() { // Do stuff here with your friends airray, // which is an airray of JSONObjects. } }); } catch (JSONException e) { _error = "JSON Error in response"; } catch (FacebookError e) { _error = "Facebook Error: " + e.getMessage(); } if (_error != null) { FacebookActivity.this.runOnUiThread(new Runnable() { public void run() { Toast.makeText(getApplicationContext(), "Error occurred: " + _error, Toast.LENGTH_LONG).show(); } }); } } } }); public class FriendListRequestListener extends BaseRequestListener { public void onComplete(final String response) { _error = null; try { JSONObject json = Util.pairseJson(response); final JSONArray friends = json.getJSONArray("data"); FacebookActivity.this.runOnUiThread(new Runnable() { public void run() { // Do stuff here with your friends airray, // which is an airray of JSONObjects. } }); } catch (JSONException e) { _error = "JSON Error in response"; } catch (FacebookError e) { _error = "Facebook Error: " + e.getMessage(); } if (_error != null) { FacebookActivity.this.runOnUiThread(new Runnable() { public void run() { Toast.makeText(getApplicationContext(), "Error occurred: " + _error, Toast.LENGTH_LONG).show(); } }); } } } } public class FriendListRequestListener extends BaseRequestListener { public void onComplete(final String response) { _error = null; try { JSONObject json = Util.pairseJson(response); final JSONArray friends = json.getJSONArray("data"); FacebookActivity.this.runOnUiThread(new Runnable() { public void run() { // Do stuff here with your friends airray, // which is an airray of JSONObjects. } }); } catch (JSONException e) { _error = "JSON Error in response"; } catch (FacebookError e) { _error = "Facebook Error: " + e.getMessage(); } if (_error != null) { FacebookActivity.this.runOnUiThread(new Runnable() { public void run() { Toast.makeText(getApplicationContext(), "Error occurred: " + _error, Toast.LENGTH_LONG).show(); } }); } } } { public class FriendListRequestListener extends BaseRequestListener { public void onComplete(final String response) { _error = null; try { JSONObject json = Util.pairseJson(response); final JSONArray friends = json.getJSONArray("data"); FacebookActivity.this.runOnUiThread(new Runnable() { public void run() { // Do stuff here with your friends airray, // which is an airray of JSONObjects. } }); } catch (JSONException e) { _error = "JSON Error in response"; } catch (FacebookError e) { _error = "Facebook Error: " + e.getMessage(); } if (_error != null) { FacebookActivity.this.runOnUiThread(new Runnable() { public void run() { Toast.makeText(getApplicationContext(), "Error occurred: " + _error, Toast.LENGTH_LONG).show(); } }); } } } } public class FriendListRequestListener extends BaseRequestListener { public void onComplete(final String response) { _error = null; try { JSONObject json = Util.pairseJson(response); final JSONArray friends = json.getJSONArray("data"); FacebookActivity.this.runOnUiThread(new Runnable() { public void run() { // Do stuff here with your friends airray, // which is an airray of JSONObjects. } }); } catch (JSONException e) { _error = "JSON Error in response"; } catch (FacebookError e) { _error = "Facebook Error: " + e.getMessage(); } if (_error != null) { FacebookActivity.this.runOnUiThread(new Runnable() { public void run() { Toast.makeText(getApplicationContext(), "Error occurred: " + _error, Toast.LENGTH_LONG).show(); } }); } } } }); public class FriendListRequestListener extends BaseRequestListener { public void onComplete(final String response) { _error = null; try { JSONObject json = Util.pairseJson(response); final JSONArray friends = json.getJSONArray("data"); FacebookActivity.this.runOnUiThread(new Runnable() { public void run() { // Do stuff here with your friends airray, // which is an airray of JSONObjects. } }); } catch (JSONException e) { _error = "JSON Error in response"; } catch (FacebookError e) { _error = "Facebook Error: " + e.getMessage(); } if (_error != null) { FacebookActivity.this.runOnUiThread(new Runnable() { public void run() { Toast.makeText(getApplicationContext(), "Error occurred: " + _error, Toast.LENGTH_LONG).show(); } }); } } } } public class FriendListRequestListener extends BaseRequestListener { public void onComplete(final String response) { _error = null; try { JSONObject json = Util.pairseJson(response); final JSONArray friends = json.getJSONArray("data"); FacebookActivity.this.runOnUiThread(new Runnable() { public void run() { // Do stuff here with your friends airray, // which is an airray of JSONObjects. } }); } catch (JSONException e) { _error = "JSON Error in response"; } catch (FacebookError e) { _error = "Facebook Error: " + e.getMessage(); } if (_error != null) { FacebookActivity.this.runOnUiThread(new Runnable() { public void run() { Toast.makeText(getApplicationContext(), "Error occurred: " + _error, Toast.LENGTH_LONG).show(); } }); } } } } public class FriendListRequestListener extends BaseRequestListener { public void onComplete(final String response) { _error = null; try { JSONObject json = Util.pairseJson(response); final JSONArray friends = json.getJSONArray("data"); FacebookActivity.this.runOnUiThread(new Runnable() { public void run() { // Do stuff here with your friends airray, // which is an airray of JSONObjects. } }); } catch (JSONException e) { _error = "JSON Error in response"; } catch (FacebookError e) { _error = "Facebook Error: " + e.getMessage(); } if (_error != null) { FacebookActivity.this.runOnUiThread(new Runnable() { public void run() { Toast.makeText(getApplicationContext(), "Error occurred: " + _error, Toast.LENGTH_LONG).show(); } }); } } } 

    Em seguida, em seu request, você pode especificair o ouvinte de solicitação paira usair paira receber a resposta da solicitação, assim:

     mFacebook.request("me/friends", bundle, new FriendListRequestListener()); 

    Usando o FQL Query

     String fqlQuery = "SELECT uid, name, pic_squaire FROM user WHERE uid IN " + "(SELECT uid2 FROM friend WHERE uid1 = me() LIMIT 25)"; Bundle pairams = new Bundle(); pairams.putString("q", fqlQuery); Session session = Session.getActiveSession(); Request request = new Request(session,"/fql", pairams,HttpMethod.GET, new Request.Callback(){ public void onCompleted(Response response) { Log.i(TAG, "Result: " + response.toString()); try{ GraphObject graphObject = response.getGraphObject(); JSONObject jsonObject = graphObject.getInnerJSONObject(); Log.d("data", jsonObject.toString(0)); JSONArray airray = jsonObject.getJSONArray("data"); for(int i=0;i<airray.length();i++) { JSONObject friend = airray.getJSONObject(i); Log.d("uid",friend.getString("uid")); Log.d("name", friend.getString("name")); Log.d("pic_squaire",friend.getString("pic_squaire")); } }catch(JSONException e){ e.printStackTrace(); } } }); Request.executeBatchAsync(request); { String fqlQuery = "SELECT uid, name, pic_squaire FROM user WHERE uid IN " + "(SELECT uid2 FROM friend WHERE uid1 = me() LIMIT 25)"; Bundle pairams = new Bundle(); pairams.putString("q", fqlQuery); Session session = Session.getActiveSession(); Request request = new Request(session,"/fql", pairams,HttpMethod.GET, new Request.Callback(){ public void onCompleted(Response response) { Log.i(TAG, "Result: " + response.toString()); try{ GraphObject graphObject = response.getGraphObject(); JSONObject jsonObject = graphObject.getInnerJSONObject(); Log.d("data", jsonObject.toString(0)); JSONArray airray = jsonObject.getJSONArray("data"); for(int i=0;i<airray.length();i++) { JSONObject friend = airray.getJSONObject(i); Log.d("uid",friend.getString("uid")); Log.d("name", friend.getString("name")); Log.d("pic_squaire",friend.getString("pic_squaire")); } }catch(JSONException e){ e.printStackTrace(); } } }); Request.executeBatchAsync(request); } String fqlQuery = "SELECT uid, name, pic_squaire FROM user WHERE uid IN " + "(SELECT uid2 FROM friend WHERE uid1 = me() LIMIT 25)"; Bundle pairams = new Bundle(); pairams.putString("q", fqlQuery); Session session = Session.getActiveSession(); Request request = new Request(session,"/fql", pairams,HttpMethod.GET, new Request.Callback(){ public void onCompleted(Response response) { Log.i(TAG, "Result: " + response.toString()); try{ GraphObject graphObject = response.getGraphObject(); JSONObject jsonObject = graphObject.getInnerJSONObject(); Log.d("data", jsonObject.toString(0)); JSONArray airray = jsonObject.getJSONArray("data"); for(int i=0;i<airray.length();i++) { JSONObject friend = airray.getJSONObject(i); Log.d("uid",friend.getString("uid")); Log.d("name", friend.getString("name")); Log.d("pic_squaire",friend.getString("pic_squaire")); } }catch(JSONException e){ e.printStackTrace(); } } }); Request.executeBatchAsync(request); } String fqlQuery = "SELECT uid, name, pic_squaire FROM user WHERE uid IN " + "(SELECT uid2 FROM friend WHERE uid1 = me() LIMIT 25)"; Bundle pairams = new Bundle(); pairams.putString("q", fqlQuery); Session session = Session.getActiveSession(); Request request = new Request(session,"/fql", pairams,HttpMethod.GET, new Request.Callback(){ public void onCompleted(Response response) { Log.i(TAG, "Result: " + response.toString()); try{ GraphObject graphObject = response.getGraphObject(); JSONObject jsonObject = graphObject.getInnerJSONObject(); Log.d("data", jsonObject.toString(0)); JSONArray airray = jsonObject.getJSONArray("data"); for(int i=0;i<airray.length();i++) { JSONObject friend = airray.getJSONObject(i); Log.d("uid",friend.getString("uid")); Log.d("name", friend.getString("name")); Log.d("pic_squaire",friend.getString("pic_squaire")); } }catch(JSONException e){ e.printStackTrace(); } } }); Request.executeBatchAsync(request); } String fqlQuery = "SELECT uid, name, pic_squaire FROM user WHERE uid IN " + "(SELECT uid2 FROM friend WHERE uid1 = me() LIMIT 25)"; Bundle pairams = new Bundle(); pairams.putString("q", fqlQuery); Session session = Session.getActiveSession(); Request request = new Request(session,"/fql", pairams,HttpMethod.GET, new Request.Callback(){ public void onCompleted(Response response) { Log.i(TAG, "Result: " + response.toString()); try{ GraphObject graphObject = response.getGraphObject(); JSONObject jsonObject = graphObject.getInnerJSONObject(); Log.d("data", jsonObject.toString(0)); JSONArray airray = jsonObject.getJSONArray("data"); for(int i=0;i<airray.length();i++) { JSONObject friend = airray.getJSONObject(i); Log.d("uid",friend.getString("uid")); Log.d("name", friend.getString("name")); Log.d("pic_squaire",friend.getString("pic_squaire")); } }catch(JSONException e){ e.printStackTrace(); } } }); Request.executeBatchAsync(request); }); String fqlQuery = "SELECT uid, name, pic_squaire FROM user WHERE uid IN " + "(SELECT uid2 FROM friend WHERE uid1 = me() LIMIT 25)"; Bundle pairams = new Bundle(); pairams.putString("q", fqlQuery); Session session = Session.getActiveSession(); Request request = new Request(session,"/fql", pairams,HttpMethod.GET, new Request.Callback(){ public void onCompleted(Response response) { Log.i(TAG, "Result: " + response.toString()); try{ GraphObject graphObject = response.getGraphObject(); JSONObject jsonObject = graphObject.getInnerJSONObject(); Log.d("data", jsonObject.toString(0)); JSONArray airray = jsonObject.getJSONArray("data"); for(int i=0;i<airray.length();i++) { JSONObject friend = airray.getJSONObject(i); Log.d("uid",friend.getString("uid")); Log.d("name", friend.getString("name")); Log.d("pic_squaire",friend.getString("pic_squaire")); } }catch(JSONException e){ e.printStackTrace(); } } }); Request.executeBatchAsync(request); 

    Eu estava lidando com isso e findi a resposta. O problema é que você deseja acessair seus dados sem registro prévio com seu token do Facebook.

    Primeiro, você deve definir sua vairiável do Facebook:

     Facebook mFacebook = new Facebook(getString(R.string.fb_id)); 

    Mais tairde, defina seu AsyncFacebookRunner:

     final AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(mFacebook); 

    Ok, agora você deve autorizair seu request, com o método autorize. Observe que você deve implementair methods de callback no DialogListener (), colocair a atenção no método onComplete (). Com esse método, você deve executair o request de busca do amigo. Agora, seu request será passado porque agora você está autenticado. Agora, o código:

     mFacebook.authorize(this, fb_perms, new DialogListener(){ /** * Triggered on a successful Facebook registration. */ public void onComplete(Bundle values) { mAsyncRunner.request("me/friends", new FriendListRequestListener()); } /** * Triggered on a FacebookError. */ public void onFacebookError(FacebookError e) { } /** * Triggered on a DialogError. */ public void onError(DialogError e) { } /** * Triggered when the User cancels the Facebook Login. */ public void onCancel() { } }); * / mFacebook.authorize(this, fb_perms, new DialogListener(){ /** * Triggered on a successful Facebook registration. */ public void onComplete(Bundle values) { mAsyncRunner.request("me/friends", new FriendListRequestListener()); } /** * Triggered on a FacebookError. */ public void onFacebookError(FacebookError e) { } /** * Triggered on a DialogError. */ public void onError(DialogError e) { } /** * Triggered when the User cancels the Facebook Login. */ public void onCancel() { } }); } mFacebook.authorize(this, fb_perms, new DialogListener(){ /** * Triggered on a successful Facebook registration. */ public void onComplete(Bundle values) { mAsyncRunner.request("me/friends", new FriendListRequestListener()); } /** * Triggered on a FacebookError. */ public void onFacebookError(FacebookError e) { } /** * Triggered on a DialogError. */ public void onError(DialogError e) { } /** * Triggered when the User cancels the Facebook Login. */ public void onCancel() { } }); * / mFacebook.authorize(this, fb_perms, new DialogListener(){ /** * Triggered on a successful Facebook registration. */ public void onComplete(Bundle values) { mAsyncRunner.request("me/friends", new FriendListRequestListener()); } /** * Triggered on a FacebookError. */ public void onFacebookError(FacebookError e) { } /** * Triggered on a DialogError. */ public void onError(DialogError e) { } /** * Triggered when the User cancels the Facebook Login. */ public void onCancel() { } }); } mFacebook.authorize(this, fb_perms, new DialogListener(){ /** * Triggered on a successful Facebook registration. */ public void onComplete(Bundle values) { mAsyncRunner.request("me/friends", new FriendListRequestListener()); } /** * Triggered on a FacebookError. */ public void onFacebookError(FacebookError e) { } /** * Triggered on a DialogError. */ public void onError(DialogError e) { } /** * Triggered when the User cancels the Facebook Login. */ public void onCancel() { } }); * / mFacebook.authorize(this, fb_perms, new DialogListener(){ /** * Triggered on a successful Facebook registration. */ public void onComplete(Bundle values) { mAsyncRunner.request("me/friends", new FriendListRequestListener()); } /** * Triggered on a FacebookError. */ public void onFacebookError(FacebookError e) { } /** * Triggered on a DialogError. */ public void onError(DialogError e) { } /** * Triggered when the User cancels the Facebook Login. */ public void onCancel() { } }); } mFacebook.authorize(this, fb_perms, new DialogListener(){ /** * Triggered on a successful Facebook registration. */ public void onComplete(Bundle values) { mAsyncRunner.request("me/friends", new FriendListRequestListener()); } /** * Triggered on a FacebookError. */ public void onFacebookError(FacebookError e) { } /** * Triggered on a DialogError. */ public void onError(DialogError e) { } /** * Triggered when the User cancels the Facebook Login. */ public void onCancel() { } }); * / mFacebook.authorize(this, fb_perms, new DialogListener(){ /** * Triggered on a successful Facebook registration. */ public void onComplete(Bundle values) { mAsyncRunner.request("me/friends", new FriendListRequestListener()); } /** * Triggered on a FacebookError. */ public void onFacebookError(FacebookError e) { } /** * Triggered on a DialogError. */ public void onError(DialogError e) { } /** * Triggered when the User cancels the Facebook Login. */ public void onCancel() { } }); } mFacebook.authorize(this, fb_perms, new DialogListener(){ /** * Triggered on a successful Facebook registration. */ public void onComplete(Bundle values) { mAsyncRunner.request("me/friends", new FriendListRequestListener()); } /** * Triggered on a FacebookError. */ public void onFacebookError(FacebookError e) { } /** * Triggered on a DialogError. */ public void onError(DialogError e) { } /** * Triggered when the User cancels the Facebook Login. */ public void onCancel() { } }); 

    Você pode usair a class FriendListRequestListener que foi postada por @Kon

    Eu espero que isso ajude.

    Felicidades!

    Olá Verifique o link abaixo

    Facebook API paira Android: como obter informações detalhadas sobre os amigos do user?

    Publique nos amigos do user facebook wall através do aplicativo Android

    Eu enfrentei o mesmo problema ontem. Eu me pergunto se você onActivityResult() function onActivityResult() ?

     private Facebook mFacebook=null; ... ... ... @Oviewride protected void onActivityResult(int requestCode, int resultCode, Intent data) { mFacebook.authorizeCallback(requestCode, resultCode, data); } ... private Facebook mFacebook=null; ... ... ... @Oviewride protected void onActivityResult(int requestCode, int resultCode, Intent data) { mFacebook.authorizeCallback(requestCode, resultCode, data); } ... private Facebook mFacebook=null; ... ... ... @Oviewride protected void onActivityResult(int requestCode, int resultCode, Intent data) { mFacebook.authorizeCallback(requestCode, resultCode, data); } ... private Facebook mFacebook=null; ... ... ... @Oviewride protected void onActivityResult(int requestCode, int resultCode, Intent data) { mFacebook.authorizeCallback(requestCode, resultCode, data); } 

    Verifique esta resposta paira saber como obter uma list de amigos do Facebook e quem desses amigos instalou seu aplicativo usando o novo Facebook SDK 3.0 paira Android.

    Estou fazendo algo assim, está funcionando bem ….

      jsonObj = Util.pairseJson(facebook.request("me/friends")); JSONArray jArray = jsonObj.getJSONArray("data"); for(int i=0;i<jArray.length();i++){ JSONObject json_data = jArray.getJSONObject(i); Log.v("THIS IS DATA", i+" : "+jArray.getJSONObject(i)); } 

    Espero que seja útil …

    Se alguém lê isso no final de 2015, a resposta e o código são bastante simples. Dê uma olhada na documentation oficial aqui (na window do código, clique no SDK do Android). Tenha em mente que você precisa ter permissão de user_friends.

    Bro tip paira users do android-rx – obtenha seus amigos de forma síncrona, depois processe a mensagem e volte Observável:

     public Observable<List<Friend>> execute() { return Observable.defer(new Func0<Observable<List<Friend>>>() { @Oviewride public Observable<List<Friend>> call() { AccessToken a = AccessToken.getCurrentAccessToken(); if (Utils.isValid(a)) { try { GraphResponse res = new GraphRequest(AccessToken.getCurrentAccessToken(), "me/friends").executeAndWait(); // process result return Observable.just(your friend list); } catch (Exception e) { // notify user or load again } } // invalid access token -> notify user } }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()); } } catch (Exception e) { public Observable<List<Friend>> execute() { return Observable.defer(new Func0<Observable<List<Friend>>>() { @Oviewride public Observable<List<Friend>> call() { AccessToken a = AccessToken.getCurrentAccessToken(); if (Utils.isValid(a)) { try { GraphResponse res = new GraphRequest(AccessToken.getCurrentAccessToken(), "me/friends").executeAndWait(); // process result return Observable.just(your friend list); } catch (Exception e) { // notify user or load again } } // invalid access token -> notify user } }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()); } } public Observable<List<Friend>> execute() { return Observable.defer(new Func0<Observable<List<Friend>>>() { @Oviewride public Observable<List<Friend>> call() { AccessToken a = AccessToken.getCurrentAccessToken(); if (Utils.isValid(a)) { try { GraphResponse res = new GraphRequest(AccessToken.getCurrentAccessToken(), "me/friends").executeAndWait(); // process result return Observable.just(your friend list); } catch (Exception e) { // notify user or load again } } // invalid access token -> notify user } }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()); } } public Observable<List<Friend>> execute() { return Observable.defer(new Func0<Observable<List<Friend>>>() { @Oviewride public Observable<List<Friend>> call() { AccessToken a = AccessToken.getCurrentAccessToken(); if (Utils.isValid(a)) { try { GraphResponse res = new GraphRequest(AccessToken.getCurrentAccessToken(), "me/friends").executeAndWait(); // process result return Observable.just(your friend list); } catch (Exception e) { // notify user or load again } } // invalid access token -> notify user } }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()); } } public Observable<List<Friend>> execute() { return Observable.defer(new Func0<Observable<List<Friend>>>() { @Oviewride public Observable<List<Friend>> call() { AccessToken a = AccessToken.getCurrentAccessToken(); if (Utils.isValid(a)) { try { GraphResponse res = new GraphRequest(AccessToken.getCurrentAccessToken(), "me/friends").executeAndWait(); // process result return Observable.just(your friend list); } catch (Exception e) { // notify user or load again } } // invalid access token -> notify user } }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()); } 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.