Android Getting Facebook friend list with SDK 3.0 -


i'm trying day facebook friend list using facebook sdk 3.0 don't want use friendpickerfragment, since don't want display picker, want create own list of friends (displaying name , image).

according post facebook friends list returns empty possible if friend approves app, when tried wife's account , mine, i'm still not able friend list.

any highly appreciated, i've spend time on , reach dead lock.

thanks!

precondition:
1. create app on facebook.
2. add hash code of android app facebook app.

android app:
permission (on fb account created fb app)

authbutton.setreadpermissions(arrays.aslist("basic_info, user_friends")); 

authbutton com.facebook.widget.loginbutton (you can refer sample apps find out how login button works)

method friend list:

   request r = new request(session, "/me/friends", null,httpmethod.get, new request.callback() {                         @override                         public void oncompleted(response response) {                             try {                                 graphobject graphobj = response.getgraphobject();                                 if(graphobj != null){                                     arraylist<fbfriend> friendarraylist = new arraylist<fbfriend>();                                     jsonobject jsonobj = graphobj.getinnerjsonobject();                                     jsonarray array = jsonobj.getjsonarray(data_node);                                     for(int = 0; < array.length(); i++){                                         jsonobject jobj = (jsonobject)array.get(i);                                         string id = jobj.getstring(fbfriend.id_note);                                         string name = jobj.getstring(fbfriend.name_note);                                         fbfriend f = new fbfriend(id, name);                                         friendarraylist.add(f);                                     }                                 }                             }                         }                     }); r.executeasync() 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -