FQL using facebook android SDK?

Here is some sample code using the suggested patch: Bundle be = new Bundle(); b. PutString("access_token", facebookManager.mFacebook.getAccessToken()); b. PutString("query", "SELECT name FROM user WHERE uid = me()"); try { String myResult = Util.

OpenUrl("https://api.facebook. Com/method/fql. Query", "GET", b); Log.

I("MyResult", myResult); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }.

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 GetJSONObject( I ); String id = friend.

GetString( "uid" ); String name = friend. GetString( "name" ); ... }.

It looks like the Android Facebook SDK doesn't URL encode the params for the old REST api. So when you send a big FQL query it can't handle all the spaces and special characters. I'll probably put a fork up on github that fixes this, but in the meantime you can change line 26 in com.facebook.android.

Util to: sb. Append(key + "=" + URLEncoder. Encode(parameters.

GetString(key))); Notice the URLEncoder call there. That's actually the deprecated version of the method but it will work fine for now, I'll include the correct one when I push to github.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions