1
votes

I have a blog which shows a Facebook like button under every post. I want to add that button, which upon click, just like that blog post, to an android app. Is that possible? If yes, then how?

Do I have to use Facebook SDK?

This is how the button is displayed in the blog.

<iframe allowTransparency='true' expr:src='&quot;http://www.facebook.com/plugins/like.php?href=&quot; + data:post.canonicalUrl+&quot;&amp;send=false&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=21&quot;' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:90px; height:21px;'/>
1
How do you plan on displaying the blog? - Dan S
That thing is ready, Sir. I used a RSS Feed Parser. The tag for Facebook like button is not available in the RSS feed, for obvious reasons. - user2320244

1 Answers

0
votes

Try this : It's working for me

<com.facebook.widget.LikeView
                    android:id="@+id/like"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:text="Like"
                    />

And add following code in your android class file:

  LikeView likeView = (LikeView) findViewById(R.id.like);
        likeView.setObjectId("Your URL);