Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6960341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:23:25+00:00 2026-05-27T15:23:25+00:00

I want to integrate a like button in my android app. I used the

  • 0

I want to integrate a like button in my android app. I used the code

likeWebView = (WebView) findViewById( R.id.webView1 );
 likeWebView.getSettings().setJavaScriptEnabled(true);
 String url = "http://www.facebook.com/plugins/like.php?" +
           "href=" + URLEncoder.encode("likeurl" ) + "&" +
           "layout=standard&" +
           "show_faces=false&" +
           "width=500&" +
           "action=like&" +
           "colorscheme=light&" +
           "access_token=" + URLEncoder.encode( "read_stream" );
likeWebView.loadUrl( url );

But after login it is showing a blank page.
Please give me a solution to add a Like button.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:23:26+00:00Added an answer on May 27, 2026 at 3:23 pm
    private initLikeButton( String urlToLike ) {
       likeWebView = (WebView) findViewById( R.id.likeWebView );
       likeWebView.getSettings().setJavaScriptEnabled(true);
    
    String url = "http://www.facebook.com/plugins/like.php?" +
           "href=" + URLEncoder.encode( urlToLike ) + "&" +
           "layout=standard&" +
           "show_faces=false&" +
           "width=375&" +
           "action=recommend&" +
           "colorscheme=light&" +
           "access_token=" + URLEncoder.encode( FacebookAdapter.getInstance().getAccessToken() );
    
    likeWebView.loadUrl( url );
    

    Here, in your code you must be put likeurl , url that like.

    using the iframe code provided by the like button code generator at http://developers.facebook.com/docs/reference/plugins/like. But since an iframe is basically the same thing as a WebView, it seemed redundant to load the code in an iframe and then load the iframe in a WebView. So instead I just loaded the code that would be in the iframe directly into the WebView using the code below. But the same thing happens either way.

    Incidentally, the same issue exists when developing an iPhone app. We don’t want the user to have to login to facebook every time they run our app. But unfortunately, if the user has logged into facebook on another computer since the last time they logged into facebook via our app, they’ll have to log in again.

    On the android platform I would think a better solution might be to have a facebook app that you send an intent to that takes care of keeping the user logged in and returning the html for rendering the like button.

    see more: https://github.com/facebook/facebook-android-sdk/issues/17

    http://blog.doityourselfandroid.com/2011/02/28/30-minute-guide-integrating-facebook-android-application/

    http://www.integratingstuff.com/2010/10/14/integrating-facebook-into-an-android-application/

    integrate facebook with like button in android and iphone

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to integrate facebook with like button in android and iphone. I integrated
I want to integrate the zxing source code to my Android application. I have
We want to integrate the facebook login button plugin, facebook like button, facebook comments
I am developing an android application where I want to integrate facebook like. I
i want to integrate twitter like IOS- 5 in my app. like IOS-5 i
I want to integrate some existing Perl code with ASP.NET. I see plenty examples
I want to integrate photologue with my Django app and use it to display
I would like to integrate my app with Facebook, Twitter and Flickr. But the
I want to interigrate i like it button in my Iphone/ Ipad application please
I want to integrate my flash file with php code. I got the below

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.