You wrote:
Is there a way to find friends, names and images in a single query?
Yes, perhaps using FQL and User and Friend FQL Tables:
SELECT uid, name, pic, pic_small, pic_big, FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())
In your Android application, you can make the FQL query as follows:
String query = "SELECT uid, name, pic, pic_small, pic_big FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())"; Bundle params = new Bundle(); params.putString("method", "fql.query"); params.putString("query", query); mAsyncFacebookRunner.request(null, params, new CustomRequestListener());
where CustomRequestListener() extends RequestListener in the Android Android SDK.
This will return:
- ID
- Username
- URLs for default images, small and large profiles
for current friends of the user.
source share