如何向我的 android 应用程序添加一个按钮而不是像 Facebook 页面那样? [英] How to add to my android application a button than do like to a facebook page?

查看:19
本文介绍了如何向我的 android 应用程序添加一个按钮而不是像 Facebook 页面那样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过了:https://github.com/crowjdh/android-facebook-like-button-integration

但它不起作用.当用户按下我正在开发的 android 应用程序的按钮时,我搜索的东西比喜欢"我的 facebook 页面更简单.谢谢

解决方案

使用这个库:Android 版 Facebook Like 按钮.这里有详细的手册.>

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

Gradle 依赖:

存储库 {MavenCentral()}依赖{编译 'com.shamanland:facebook-like-button:0.1.8'}

添加喜欢按钮的最简单方法:

此视图将在您的布局中绘制:

另外还有一个包含喜欢计数的框.

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

解决方案

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:

In additional there is box with count of likes.

这篇关于如何向我的 android 应用程序添加一个按钮而不是像 Facebook 页面那样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆