I'm trying to create an android application using the facebook android SDK (http://github.com/facebook/facebook-android-sdk). I'm trying to figure out if I will be able to use FQL using this SDK. If anyone has any experiences in this regard, please let me know.
FQL can apparently be used using https://api.facebook.com/method/fql.query?query=QUERY, the facebook android SDK however doesn't seem to support this.
Thanks;
This is probably a better way than mentioned. Using the current version of the API you don't need to manually add the access token or use Util.openURL.
Bundle params = new Bundle();
params.putString("method", "fql.query");
params.putString("query", "SELECT name, uid, pic_square FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me()) ORDER BY name");
String response = $fb.request(params);
response = "{\"data\":" + response + "}";
JSONObject json = Util.parseJson( response );
JSONArray data = json.getJSONArray( "data" );
for ( int i = 0, size = data.length(); i < size; i++ ){
JSONObject friend = data.getJSONObject( i );
String id = friend.getString( "uid" );
String name = friend.getString( "name" );
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With