Thursday, September 13, 2012

Facebook "Like" Button for iOS , Android and Blackberry



Before using this below code, please add facebook library to your project and use token of facebook Api to like facebook page.

public String likeFacebookButton( String urlWantToLike ) {

String url = null;

if(facebook.isSessionValid())
{
url = "http://www.facebook.com/plugins/like.php?" +
"href=" + URLEncoder.encode( urlWantToLike ) + "&" +
"send=false&"+
"layout=button_count&" +
"show_faces=false&" +
"width=100&" +
"height=21&"+
"action=like&" +
"font=arial&"+
"colorscheme=light&" +
"access_token=" + URLEncoder.encode( facebook.getAccessToken() );

}
return url;
}

1 comment:

Unknown said...

working fine...
how to make button image center