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
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.
WebView
. This web-view will keep user session. –
Bumbling xmlns:app="http://schemas.android.com/apk/res-auto"
–
Bumbling You can create a webview and put your button inside.
You can try something like this :
String url = "http://www.facebook.com/plugins/like.php?layout=standard&show_faces=true&width=80&height=50&action=like&colorscheme=light&href=http://beta.demo.dy/web/service/304.htm";
// webview = (WebView) findViewById(R.id.webview);
webView.loadUrl(url);
webView.setWebViewClient(new WebViewClient());
class LikeWebviewClient extends WebViewClient
{
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}
© 2022 - 2024 — McMap. All rights reserved.