-1

I'm trying to create a simple ArrayList of of the names in my Friends List, so that I can apply it to my ListView. Does anyone have experience with this, and know how to do it? Thank you. Everything in my code is working, but I have no idea where to start with this, and Google has not proven helpful.

Courtbird
  • 43
  • 1
  • 7
  • 1
    Everything in my code is working? what is in your code? – Nick Cardoso Apr 27 '14 at 20:14
  • I just have a ListView that displays an ArrayList. I just want to figure out how to access the user's friends list, and create an ArrayList of their names. – Courtbird Apr 27 '14 at 20:22
  • Have you looked at the Facebook SDK? Post what you have tried – Nick Cardoso Apr 27 '14 at 20:28
  • https://developers.facebook.com/docs/android/scrumptious/show-friends/ I tried this tutorial- but it didn't work at all, so I decided to simplify it and start by making a ListView that works properly. What I figured, is there must be some method for getting a list of facebook friends, and then another for pulling their names out of the objects. I just can't find it in the Facebook SDK. – Courtbird Apr 27 '14 at 20:39
  • This seems to be what I'm looking for https://developers.facebook.com/docs/graph-api/reference/friendlist/ – Courtbird Apr 27 '14 at 20:49
  • That will get you the list of lists. If you've just now found that it seems to imply you haven't looked for yourself before asking – Nick Cardoso Apr 27 '14 at 20:54
  • I've looked I just fail to understand the documentation. This is my first Android application, and the documentation is confusing me very much. – Courtbird Apr 27 '14 at 23:52

1 Answers1

0

If you have set up your sdk correctly their tutorial should work, I've used many of them. I would suggest you research FBQL, and how to use it, I found it much better for getting exactly what I needed as their SDK does not implement many features via the Graph API, and those that it does do not offer very granular control.

Alternatively I found the Simple Facebook project really did simplify some requests such as this. You can find that here: https://github.com/sromku/android-simple-facebook

Without some code there's not much more help I can offer (or I'd hazard, that many others can offer)

EDIT

https://developers.facebook.com/docs/graph-api/reference/user/friends/

new Request(
    session,
    "/me/friends",
    null,
    HttpMethod.GET,
    new Request.Callback() {
        public void onCompleted(Response response) {
            /* handle the result */
        }
    }
).executeAsync();
Nick Cardoso
  • 20,807
  • 14
  • 73
  • 124
  • Hm... I am using android studio, and followed the instructions on the facebook SDK site to set up th esdk – Courtbird Apr 27 '14 at 20:57
  • http://stackoverflow.com/questions/19961828/using-facebook-sdk-in-android-studio I used this to set up the Facebook SDK, I believe it was done right. – Courtbird Apr 27 '14 at 21:06
  • They used to have a setup document for android studio but I tried the link and it's gone now. If you are sure it's set up correctly and are getting no errors then the link ive added to my answer should be the call you need – Nick Cardoso Apr 27 '14 at 21:24