帮助在Facebook上张贴到Android的朋友贴到、朋友、Facebook、Android

2023-09-07 12:36:42 作者:丢了时光荒了年华

我是新来Android..I想发布图片给我的朋友沃尔使用Facebook的。

I am new to Android..I would like to Post a Image to my friends Wall using Facebook.

我已经下载code登录我的帐户说peter@gmail.com并抓住所有我的朋友名单中并填充我所有的朋友在列表视图中。

I have downloaded code from GitHub source..I logged in my account Say peter@gmail.com and grab all of my friends list and populate all my friends in List View..

我有ID和所有朋友的名字叫......

I am having ID's and Name's of all friends...

我要发布在我的朋友..墙的任何一个图片

I want to post a image in any one of my friend Wall..

Thanks..Pet​​er ..

Thanks..Peter..

推荐答案

试试这个:

try{
    Bundle parameters = new Bundle();
    JSONObject attachment = new JSONObject();

    try {
        attachment.put("message", "Messages");
        attachment.put("name", "Get utellit to send messages like this!");
        attachment.put("href", link);
    } catch (JSONException e) {
    }
    parameters.putString("attachment", attachment.toString());
    parameters.putString("message", "Text is lame. Listen up:");
    parameters.putString("target_id", "XXXXX"); // target Id in which you need to Post 
    parameters.putString("method", "stream.publish");
    String  response = authenticatedFacebook.request(parameters);       
    Log.v("response", response);
}
catch(Exception e){}

另外,请查阅本作参考Post对好友留言