English 中文(简体)
FQL 采用脸谱和roid体
原标题:FQL using facebook android SDK
问题回答

这或许比上述方法好。 采用目前版本的普兰诺特语,你不需要人工增加获得或使用的机会。

        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" );
            ...
        }

此处使用建议发送的样本代码如下:

    Bundle b = 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();
        }

我的解决办法是:

您真正需要的是使用<代码>图示>。 在和roid的SDK中,已经提供了两种版本的快速执行方法。 另一种做法是,在你要求根据请求执行请求之前,提出请求并修改请求。 我的方法使用后版本。

如果在<条码>范围内,请打电话:

Request r = new Request.newGraphPathRequest(getSession(), "fql", 
    new Request.Callback() {
        @Override
        public void onCompleted(Response response) {
           // your FQL result will be stored in response.getGraphObject()
           Log.d("result", response.toString());
        }
    }
);
r.getParameters().putString("q", YOUR_QUERY_HERE);
r.executeAsync();

希望这一帮助。

注:I m 采用DDK 3.0

它像Athony SDK don t URL encodems for the original REST api。 因此,当你发出大的FL质问时,它可以处理所有空间和特殊性质。 我也许会把一旁遮蔽起来,但与此同时,你可以改变一下子26。 和roid。 直至:

sb.append(key + "=" + URLEncoder.encode(parameters.getString(key)));

通知《欧洲刑法》要求。 这实际上就是该方法的折旧版本,但现在该方法将进行罚款。





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签