Software Archive
Read-only legacy content
17061 Discussions

Problems with internet connection test

Thiago_A_
Beginner
824 Views

Hi everyone,

I'm using Intel XDK to create an app, but i'm with a problem, i think isn't so hard to solve but i expended all my saturday and i couldn't solve.

Here is the javascript

function testConnection()
{
   intel.xdk.device.updateConnection();
   document.getElementById("Desc").innerHTML = intel.xdk.device.connection;
}

Here is the html

<!DOCTYPE html>

<html>
<head>
    <title>Blank HTML</title>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <script src="intelxdk.js"></script>       
    <script src="cordova.js"></script>        
    <script src="xhr.js"></script>   
    <script src="js/init-app.js"></script>  
    <script src="js/app.js"></script>  
    <link rel="stylesheet" href="css/app.css">
</head>
<body>
    <h3>internet test?</h3>
    <p class="align-center"><input class="button" type="button" id="bt_BuscaConect" value="connection" onclick="testConnection()"/></p>
    <p id="Desc">test</p>
</body>
</html>

I just want to change the text when i click the button and show the connection, this code works when i'm emulating and when i'm debugging in my tablet Nexus 7, but doesn't work when i create the APK and install in my nexus. My android version is 5.0.2. I tried to use all cordova plugins, and still doesn't work.

 

0 Kudos
1 Solution
Hamilton_Tenório_da_
Valued Contributor I
824 Views

I use without especial permission. Try to remove that. 

Another sugestion: put a error catch on your .js file:

//ativar em caso de necessidade de entender algum erro
window.onerror = function (errorMsg, url, lineNumber, column, errorObj) {
    alert('Error: ' + errorMsg + ' Script: ' + url + ' Line: ' + lineNumber
    + ' Column: ' + column + ' StackTrace: ' +  errorObj);
}

Maybe this will show you some error.

View solution in original post

0 Kudos
3 Replies
Hamilton_Tenório_da_
Valued Contributor I
824 Views

Look at the plugins and permissions that you selected. Maybe you need indicate another one.

0 Kudos
Thiago_A_
Beginner
824 Views

I createded another project, you can see in this movie, i just added some lines of code, permissions and plugins. Still doesn't work, i tried in my Nexus 7 with android 5.0.2 and in my Samsung Galaxy Ace with android 2.3.6.

0 Kudos
Hamilton_Tenório_da_
Valued Contributor I
825 Views

I use without especial permission. Try to remove that. 

Another sugestion: put a error catch on your .js file:

//ativar em caso de necessidade de entender algum erro
window.onerror = function (errorMsg, url, lineNumber, column, errorObj) {
    alert('Error: ' + errorMsg + ' Script: ' + url + ' Line: ' + lineNumber
    + ' Column: ' + column + ' StackTrace: ' +  errorObj);
}

Maybe this will show you some error.

0 Kudos
Reply