How to add to my android application a button than do like to a facebook page?

I've tried this: https://github.com/crowjdh/android-facebook-like-button-integration

but it not work. I search something more simple than do "like" to my facebook page when user press a button to android application I'm developing. thank you


Solution 1:

Use this library: Facebook Like button for Android. There is detailed manual here.

Sources: https://github.com/shamanland/facebook-like-button

Gradle dependency:

repositories {
    mavenCentral()
}

dependencies {
    compile 'com.shamanland:facebook-like-button:0.1.8'
}

The simplest way to add like button:

<com.shamanland.facebook.likebutton.FacebookLikeButton
    style="@style/Widget.FacebookLikeButton"
    app:pageUrl="http://blog.shamanland.com/"
    app:pageTitle="Developer's notes"
    app:pageText="This is blog about Android development."
    app:pagePicture="@drawable/ic_launcher"
    />

This view will be drawn in your layout: enter image description here

In additional there is box with count of likes.

enter image description here