如何在Android中将Facebook发布给朋友? [英] How to Facebook Post to friends in Android?
本文介绍了如何在Android中将Facebook发布给朋友?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是Android新手.我想使用Facebook将图像发布到朋友的墙上.
I am new to Android. I would like to post an image to my friend's Wall using Facebook.
我已经从GitHub源下载了代码.我登录了我的帐户,说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 have IDs and names of all friends.
推荐答案
尝试一下:
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){}
也请检查此内容以作为参考在朋友墙上"张贴
Also check this for Reference Post on Friends Wall
这篇关于如何在Android中将Facebook发布给朋友?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文