English 中文(简体)
如何将脸书页面数据 送到我和机器人的应用程序?
原标题:how to get Facebook page data to my android application?

我需要我的粉丝页面数据, 即喜欢者的数量, 最近喜欢的用户; 到我的和机器人应用程序。

退出到facebook 日志后, 应用程序用户应该能够使用 app.

我尝试了 < a href=> "https://github.com/facebook/facebook-android-sdk/" rel="nofollow"> 脸书SDK, 用于Android , 但没有找到访问页面数据的途径。 似乎用户应该登录到Facebook上才能获取数据 。

当我查看 < a href=> http:// developmenters.facebook.com/docs/reference/api/" rel="nofollow" > this 时,可以访问喜欢的数量。但是,如何在不要求用户登录的情况下为某个页面这样做?

这件事你有什么想法吗?

问题回答
With out log in to facebook the application user should be abel to use the app.

无法访问 Facebook 详细信息 < / 强 > 。

使用此片断获取用户订阅的页面信息 :

Bundle likes_params = new Bundle();
likes_params.putString("fields", "id,name,picture");
jObj_friends_likes = new JSONObject(authenticatedFacebook.request("me/likes",likes_params));

所认证的纸面布是您的 Facebook 实例 & amp; 字段, 您可以添加您需要的字段

某些页面信息无需用户登录即可访问,例如喜欢的次数;详情请查看 这里

这就是你如何得到他们的:

private Facebook mFacebook = new Facebook("xxxxxx");
private AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(mFacebook);

mAsyncRunner.request("yourPage", new RequestListener() {

    @Override
    public void onComplete(String response, Object state) {
        Log.d(LOG_TAG, response);   // page info JSONObject
    }

    @Override
    public void onIOException(IOException e, Object state) { }

    @Override
    public void onFileNotFoundException(FileNotFoundException e,
            Object state) { }

    @Override
    public void onMalformedURLException(MalformedURLException e,
            Object state) { }

    @Override
    public void onFacebookError(FacebookError e, Object state) { }

});

P.S. Graph API Explorer 是玩“图表 API”的伟大工具。

安装 Facebook SDK 后, 试一下

/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{page-id}",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
    public void onCompleted(GraphResponse response) {
        /* handle the result */
    }
}
).executeAsync();




相关问题
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 ...

热门标签