如何添加到我的Andr​​oid应用程序中的按钮比喜欢一个Facebook页面?我的、应用程序、按钮、页面

2023-09-11 12:39:48 作者:回眸一笑鸡飞狗跳

我已经试过这样: https://github.com/crowjdh/ Android的类似Facebook的按钮集成

但它不能正常工作。 我寻找的东西比多做简单的喜欢到我的Facebook页面,当用户preSS一个按钮,Android应用程序我开发。 谢谢

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

推荐答案

使用这个库:的 Facebook的Like按钮为Android 。 有详细这里手册。

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

来源: https://github.com/shamanland/facebook-like-button

摇篮依赖性:

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:

在附加有框喜欢的计数。

In additional there is box with count of likes.