Facebook的像机器人 [英] Facebook like in android

查看:251
本文介绍了Facebook的像机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用如下所示像Facebook的URL中的code:

I am using the code shown below for like a url in facebook:

String htmlCodeGoesHere="<div id=\"fb-root\"></div>"+
            "<script>(function(d, s, id) {"+
            "  var js, fjs = d.getElementsByTagName(s)[0];"+
            "  if (d.getElementById(id)) {return;}"+
             " js = d.createElement(s); js.id = id;"+
             " js.src = \"http://connect.facebook.net/en_US/all.js#xfbml=1& appId="+APP_ID+"\";"+
             " fjs.parentNode.insertBefore(js, fjs);"+
            "}(document, 'script', 'facebook-jssdk'));</script>"+
            "<div class=\"fb-like\" data-href=\" http://www.facebook.com/ToshibaInnovation\" data-send=\"false\" data-width=\"450\" data-show-faces=\"true\">   </div>";
            webviewliketoshiba.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
            webviewliketoshiba.setBackgroundColor(Color.WHITE);


            webviewliketoshiba.setWebChromeClient(new WebChromeClient() {

                @Override
                public boolean onJsAlert(WebView view, String url, String message, final android.webkit.JsResult result) {
                    Log.e("js ", message);
                    return false;
                }
            });

            webviewliketoshiba.loadDataWithBaseURL(null, htmlCodeGoesHere, "text/html", "UTF_8", null);

这是显示像在Web视图按钮。我使用OnTouchListener的Web视图后取像特别行动。但点击按钮,像它打开,没有内容的浏览器窗口。而没能得到回应像一个页面。

This is showing like button in a web view. I am using OnTouchListener for web view to take particular actions after like. But click on like button it opens browser window with no contents. And not able to get response for like a page.

谁能帮我做一样的功能。我需要像一个Facebook页面的响应。我有一个有效的Facebook会话和tocken。通过类似URL获得积极的反响,我可以控制我的其他codeS。

Can anyone help me to do like functionality. I need response for like a facebook page. I have a valid facebook session and tocken. by getting positive responce from like a url, i can control my other codes.

推荐答案

如果您正在开发的核心部分的android应用程序,我会建议你使用Facebook,Android的SDK。请参阅以下链接:

If you are developing your application on core android part, I would suggest you to use the facebook-android-sdk. See the below link :

https://github.com/facebook/facebook-android-sdk

您可以在 http://ericosgood.com/prog/facebook找到它的教程-Android-SDK-教程/

问候。

这篇关于Facebook的像机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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