pass text to facebook wall on a button click android
I have to publish some text and image from a button on the xml layout, onclick of the button it will call an activity to share 开发者_如何学Pythonbut how to pass text and images to face book through android. please help me with an example.
probably through the facebook-api
Check this Code for Adding Image and Title in Facebook Post Wall :
String link ="www.google.com";
String image_url="http://dev.campusflock.com/img/medium_big_thumb/Deal/15.d23a69cbfb987be82dbfa563258080b9.jpg";
parameters.putString("method", "stream.publish");
parameters.putString(
"attachment",
"{\"name\":\""
+ "companyName"
+ "\",\"href\":\""
+ link
+ "\",\"description\":\""
+ "Title"
+ "\",\"media\":[{\"type\":\"image\",\"src\":\""+image_url+"\",\"href\":\"" +link+"\"}]}");
authenticatedFacebook.dialog(Main.this, "stream.publish",parameters, new TestUiServerListener());
精彩评论