Steps to activate internet access on the Samsung Gear S2

When I press a toggle on a web application for the gear s2 (javascript), I send out an http request:

( function () {

    var led001Button = document.getElementById("Led001"),
        led002Button = document.getElementById("Led002");   

    function httpReq(theUrl){
        var xmlhttp = null;
        xmlhttp = new XMLHttpRequest();
//      xmlhttp.onreadystatechange = function(){
//      if (xmlhttp.readyState == xmlhttp.DONE){
//      alert(xmlhttp.responseText);
//      }
//      else{
//      alert(xmlhttp.statusText);
//      }
//      };
//      xmlhttp.onerror = function(e){
//      alert("onerror: " + xmlhttp.statusText);
//      };
        xmlhttp.open("GET", theUrl);
        xmlhttp.send();
    }

    function checkToggle(name){
            //make box2 = box1 when checked              
               var checkbox = document.getElementById(name);
               if (checkbox.checked === true){
                   httpReq('http://school.thomashuster.nl/WebServer/edit.php?name='+name+'&value=1');
//                console.log("set "+name+" ON");
               }else{
                   httpReq('http://school.thomashuster.nl/WebServer/edit.php?name='+name+'&value=0');
//                 console.log("set "+name+" OFF");
               }
    }           
    if (led001Button) {
        led001Button.addEventListener("change", function(){
               checkToggle("Led001");
        });
    }
    if (led002Button) {
        console.log('test');
        led002Button.addEventListener("change", function(){
               checkToggle("Led002");
        });
    }
} () );

While emulating this on the gear s2 web emulator, everything works fine.

However, when I install it on the gear s2 itself, my webserver does not receive any requests. I have granted Internet privilege and access to my webserver in the config.xml file:

<access origin="https://www.thomashuster.nl" subdomains="true"></access>
 <tizen:privilege name="http://tizen.org/privilege/internet"/>    

Despite this, it's not successful. Can anyone help me figure out what I might be missing? Thank you!

Answer №1

Have you verified that your code is not making requests from external domains?

If it is accessing data from other domains, you will need to update the access origin in the config.xml file to

<access origin="*" subdomains="true"></access>
or

<access origin="*" subdomains="true"/>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

To enable the description p tag only when the search box text matches the search criteria, otherwise keep the p tag disabled

I need to develop a search feature that includes a search box, a heading, and a paragraph description. Initially, the description should be hidden, but when a user enters text that matches the description, the paragraph tag should become visible. An exampl ...

Accessing new information seamlessly without the need for page refresh

For optimal mobile viewing of my website, I am considering implementing a select element. Here are the available options: HTML: <select name="select-choice-8" id="select-choice-nc"> <optgroup label="News"> & ...

Angular's $routeProvider fails to navigate

I'm facing an issue with my Angular JS application where the $routeProvider doesn't load the template in the ng-view section. I have set up <html data-ng-app="myApp"> and <section data-ng-view></section. The template doesn't ...

ReactJS - Unable to access property of undefined object

I encountered a TypeError when rendering, stating that my object is not defined. Despite thinking I defined it before using it. Here is an example of ArticleDetails.js that I am referencing: import React, {Component} from 'react'; class Arti ...

The nodemailer module in Node.js encountered an issue while trying to send an email, resulting

Looking to confirm registration, I want to send an email from my server (kimsufi). To accomplish this, I am utilizing nodemailer which can be found at https://github.com/andris9/Nodemailer Encountering the following error: Error occurred Sendmail exited ...

ZeroMQ and Electron integration: Unable to find the specified bindings file

Currently, I am running Windows 7 x64 with nodejs 5.1.0 and Electron 0.35. I carefully followed the instructions provided by the Electron Quick Start app and then proceeded to add the line require("zmq") to the main.js file. However, upon executing npm ins ...

Tips for concealing tick labels in d3 using TypeScript

When trying to hide tick labels by passing an empty string to the .tickFormat("") method, I encountered an issue with Typescript. The error message received was as follows: TS2769: No overload matches this call. Overload 1 of 3, '(format: null): Axi ...

Searching for a point within a specified range using Sequelize

I have a model called Location with a field named coordinates of type geometry. I'm looking to create a function that takes in latitude, longitude, and radius as parameters, and returns all locations within that radius (in meters). I attempted to foll ...

Accessing the "this" object in Vue.js components

When executing console.log(this) in the doSomething method, it returns "null". I was expecting console.log(this.currentPage) to display "main", but unfortunately, the "this" object is null.. :( Is there a way to access the value of "main" for currentPage ...

Is there a way to determine if a value exists within an array of objects?

Is it possible to determine if a specific value is present in an array of objects? I've tried a method, but it always returns false. What would be the most effective way to solve this issue? My approach: var dog_database = [ {"dog_name": "Joey" ...

how to implement dynamic water fill effects using SVG in an Angular application

Take a look at the code snippet here HTML TypeScript data = [ { name: 'server1', humidity: '50.9' }, { name: 'server2', humidity: '52.9', }, { name: 'server3', humidity: ...

Changing a JavaScript string into an array

I have extracted an array of objects from a hidden HTML input field and received the following string: "{"id":"1234","name":"john smith","email":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="dab0a9b7b3aeb29ab8b6bbb2f4b9b5b7" ...

Summoning within a rigorous mode

I am facing an issue with my configuration object: jwtOptionsProvider.config({ tokenGetter: (store) => { return store.get('token'); }, whiteListedDomains: ['localhost'] }); In strict mode, I ...

Turning off v-navigation-drawer for certain routes in Vue.js

I currently have a v-navigation-drawer implemented in my webpage using the code below in the App.vue file. However, I am looking to disable it on certain routes, such as the landing page: <v-app> <v-navigation-drawer id ="nav" persistent : ...

How can I set a header to be automatically included in every "render" response in Node.js/Express?

One of the challenges I face involves implementing "controllers" in my code: app.get('/',function(req,res){ var stuff = { 'title': 'blah' }; res.render('mytemplate',stuff); }); In particular, I'm worki ...

Retaining original input value even when validation is applied with input type="number"

Encountering an unusual scenario while using angularJs and input type="number". It seems that if the initial value of an input falls outside the specified min and max range, the value gets wiped out. To better visualize the issue, I created a fiddle - htt ...

Retrieve values from the query string (specifically from table rows and cells) for each individual line and display them in

i have some code, see: <script> $$.ready(function() { // Profile Dialog $( "#user-dialog" ).dialog({ autoOpen: false, modal: true, width: 400, open: function(){ $(this).parent().css('overflow', 'visible') ...

JavaScript / html Error: function body missing closing curly brace

I encountered an error that I'm struggling to resolve: "SyntaxError: missing } after function body". Despite not having a function named 'body', I have attempted changing every instance of 'body' in my script. However, ...

Execute a jQuery focus() function on a textarea element within a dynamically added form on the webpage

Whenever I dynamically insert a new form onto the page using clone(), my goal is to have the textarea within the form automatically focused. However, despite trying out the code below, it seems like it's not functioning as expected: .on('click&a ...

Continuous polling with Ajax in Rails does not trigger the display of an alert box

Trying to implement ajax polling using the RailsCast tutorial on ajax polling (#229) but encountering an issue where the alert box doesn't pop up after running the server. Here's the code in app/views/quotes/index.js.erb: alert('Hey') ...