Software Archive
Read-only legacy content
17061 Discussions

Connection Problem

Solution_O_
Beginner
544 Views

I am new to Intel XDK. I built my App and i uses a HTML5/Javascript code on my app to enable user to post comment. This code works in the emulaor but when i deployed my app on my Android device, it didnt work. The code is gotten from www.htmlcommentbox.com ;

Please i need help.

 

Also, is there a code i can write that will enable my app to be connected to the internet like Facebook app and the likes. Please help, its urgent

0 Kudos
9 Replies
Amrita_C_Intel
Employee
544 Views

Hello,

Emulator is just a simulator. There are some limitations just check out this link: https://software.intel.com/en-us/xdk/docs/dev-emulator

Try to build with crosswalk and use either build or debug tab to see the actual behavior of the app.

You can make use of this plugin: https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin

To include social sharing in your app. All the description is available in that github link.

0 Kudos
Elroy_A_Intel
Employee
544 Views

I recommend that you add any domain names that your applications will be communicating with to the whitelist field on the Projects panel > Build Settings > Android-Crosswalk and Android. For more information on Intel XDK whitelist, visit https://software.intel.com/en-us/xdk/docs/using-cordova-whitelist-rules-with-intel-xdk.

In regard to leveraging Facebook and the like button in your application, I recommend using the Facebook* Connect Cordova plugin (for authentication) and also recommend visiting https://github.com/Wizcorp/phonegap-facebook-plugin/blob/master/TROUBLESHOOTING.md#how-do-i-add-a-like-button for adding a like button.

Note: You can add this plugin to your application on the Intel XDK Projects > Plugin Management > Add Plugins to this Project > Featured Plugins panel.

0 Kudos
Solution_O_
Beginner
544 Views

Thank you. But i am not using any domain name for the application. I am only making use of this code 

"<!-- begin wwww.htmlcommentbox.com -->
 <div id="HCB_comment_box"><a href="http://www.htmlcommentbox.com">HTML Comment Box</a> is loading comments...</div>
 <link rel="stylesheet" type="text/css" href="//www.htmlcommentbox.com/static/skins/bootstrap/twitter-bootstrap.css?v=0" />
 <script type="text/javascript" id="hcb"> /*<!--*/ if(!window.hcb_user){hcb_user={};} (function(){var s=document.createElement("script"), l=hcb_user.PAGE || (""+window.location).replace(/'/g,"%27"), h="//www.htmlcommentbox.com";s.setAttribute("type","text/javascript");s.setAttribute("src", h+"/jread?page="+encodeURIComponent(l).replace("+","%2B")+"&opts=16862&num=10&ts=1441018594492");if (typeof s!="undefined") document.getElementsByTagName("head")[0].appendChild(s);})(); /*-->*/ </script>
<!-- end www.htmlcommentbox.com -->

"to allow the user of the app to be able to comment on it. the code is an html comment box code made of html5 and javascript.

Please copy the code into your editor and see the way it works. 

However, i use the same code in my app development and it works in the emulator but its not working on my phone. I feel the reason is because my app is loading before it connects to the internet. or better still, my app is not connecting to the internet to enable the code to work. Please i need help on this urgently.

0 Kudos
PaulF_IntelCorp
Employee
544 Views

I'm not sure what that code is supposed to do, I've "beautified" it, here:

<!-- begin wwww.htmlcommentbox.com --> 
< div id = "HCB_comment_box" > < a href = "http://www.htmlcommentbox.com" > HTML Comment Box < /a> is loading comments...</div >
< link rel = "stylesheet" type = "text/css" href = "//www.htmlcommentbox.com/static/skins/bootstrap/twitter-bootstrap.css?v=0" / >
< script type = "text/javascript" id = "hcb" > 
    if (!window.hcb_user) {
        hcb_user = {};
    }(function() {
        var s = document.createElement("script"),
            l = hcb_user.PAGE || ("" + window.location).replace(/'/g, "%27"),
            h = "//www.htmlcommentbox.com";
        s.setAttribute("type", "text/javascript");
        s.setAttribute("src", h + "/jread?page=" + encodeURIComponent(l).replace("+", "%2B") + "&opts=16862&num=10&ts=1441018594492");
        if (typeof s != "undefined") document.getElementsByTagName("head")[0].appendChild(s);
    })();
< /script>
<!-- end www.htmlcommentbox.com -->

It would be much easier to help you if you attached a simple project that illustrates the issue. Given the volume of traffic on this forum, we don't have time to build custom apps for each issue. Please ZIP up the entire project directory of a simple app that illustrates the issue. Then we might be able to help you resolve the issue.

0 Kudos
Solution_O_
Beginner
544 Views

Thank you for the code. However, the code is not doing anything. or better still, i dont know how to use the code. I have uploaded the zip file of the project here https://www.dropbox.com/s/qfmk15o82wdzvc4/FUTA%20App.zip?dl=0 

i am unable to upload it directly from here. please check it out. Thank you

0 Kudos
PaulF_IntelCorp
Employee
544 Views

I have downloaded and started your app, but I have no idea how to see this html comment box that you have inside your app, or where it might be in your app. Sorry, but you need to provide some guidance or a nice simple app that illustrates the issue. Trying to debug a large app that we know nothing about is a very time consuming task, and we have many other people to help. Please help us by either providing a simple example app that clearly illustrates the problem or by providing explicit instructions regarding how to reproduce the problem with the app you have provided.

0 Kudos
Solution_O_
Beginner
544 Views
Thank you The coment box is to be in the category pages. I mean the academics.html,campus.html,entertainment.html,fashion.html,politics.html,school.html,shop.html,sports.html and technology.html. When user click on categories in the trending topics, it will take them to a page that has the categories linked with the pages I mentioned earlier. In each category, user will be able to add comments and reply to comments I hope that's explicit Thank you
0 Kudos
PaulF_IntelCorp
Employee
544 Views

I looked at your app and where this is getting inserted, and I do not understand how this thing is supposed to work. Not much I can do for you at this point, sorry.

0 Kudos
xkevin
New Contributor I
544 Views
<!-- begin wwww.htmlcommentbox.com --> 
< div id = "HCB_comment_box" > < a href = "http://www.htmlcommentbox.com" > HTML Comment Box < /a> is loading comments...</div >
< link rel = "stylesheet" type = "text/css" href = "//www.htmlcommentbox.com/static/skins/bootstrap/twitter-bootstrap.css?v=0" / >
< script type = "text/javascript" id = "hcb" > 
    if (!window.hcb_user) {
        hcb_user = {};
    }(function() {
        var s = document.createElement("script"),
            l = hcb_user.PAGE || ("" + window.location).replace(/'/g, "%27"),
            h = "//www.htmlcommentbox.com";
        s.setAttribute("type", "text/javascript");
        s.setAttribute("src", h + "/jread?page=" + encodeURIComponent(l).replace("+", "%2B") + "&opts=16862&num=10&ts=1441018594492");
        if (typeof s != "undefined") document.getElementsByTagName("head")[0].appendChild(s);
    })();
< /script>
<!-- end www.htmlcommentbox.com -->

change to 

<!-- begin wwww.htmlcommentbox.com --> 
< div id = "HCB_comment_box" > < a href = "http://www.htmlcommentbox.com" > HTML Comment Box < /a> is loading comments...</div >
< link rel = "stylesheet" type = "text/css" href = "http://www.htmlcommentbox.com/static/skins/bootstrap/twitter-bootstrap.css?v=0" / >
< script type = "text/javascript" id = "hcb" > 
    if (!window.hcb_user) {
        hcb_user = {};
    }(function() {
        var s = document.createElement("script"),
            l = hcb_user.PAGE || ("" + window.location).replace(/'/g, "%27"),
            h = "http://www.htmlcommentbox.com";
        s.setAttribute("type", "text/javascript");
        s.setAttribute("src", h + "/jread?page=" + encodeURIComponent(l).replace("+", "%2B") + "&opts=16862&num=10&ts=1441018594492");
        if (typeof s != "undefined") document.getElementsByTagName("head")[0].appendChild(s);
    })();
< /script>
<!-- end www.htmlcommentbox.com -->

Works.. changing //www.htmlcommentbox.com to http://www.htmlcommentbox.com

0 Kudos
Reply