Software Archive
Read-only legacy content
17061 Discussions

Help! My app is working fine in App Preview but when i install it does not work!

Emir_D_
Beginner
1,371 Views

I am working on a University Project and developing an app using intel xdk. i made html +cordova on bootstrap But i'm facing weired problem! My app is working perfectly fine in App Preview app of intel xdk .. but when i install apk on my android device some buttons do not work ! i made a button and i applied onclick functions to them. this is my app.js file.

 ----------------------- app.js file -----------------------

function feedback() {
    
     var bodyText = 'write your message here';
        intel.xdk.device.sendEmail(bodyText, "amir130@icloud.com", "", true, "", "" );
    
}

 ----------------------- index.html ------------------------------

 

<button onclick="feedback();"> feedback </button>

 

 

0 Kudos
1 Solution
Adam_G_
New Contributor I
1,371 Views

Have you set the permissions on the app?  For networking permissions the emulator can ignore them but the build process does not.  To check this click on the projects tab and then look at the build settings section.  In the domain list you should add "*" (without the quotes) if it is not there.  Then check the "Allow external applications to launch from this domain?" checkbox.  Then go and save all your files and try building again.  

 

View solution in original post

0 Kudos
5 Replies
Adam_G_
New Contributor I
1,372 Views

Have you set the permissions on the app?  For networking permissions the emulator can ignore them but the build process does not.  To check this click on the projects tab and then look at the build settings section.  In the domain list you should add "*" (without the quotes) if it is not there.  Then check the "Allow external applications to launch from this domain?" checkbox.  Then go and save all your files and try building again.  

 

0 Kudos
Emir_D_
Beginner
1,371 Views

yes i have set the permission. i have already tried it no luck! 

0 Kudos
Emir_D_
Beginner
1,371 Views

This is code, i have tried it in bootstrap, jquery .. almost everything .. i have also tried it by making html5 + cordova app. nothing seems to work. here is the code, maybe you can figure out the problem. It is working in intel's app preview app on android. its working perfectly fine. but when i build apk file and install it on my android the button does not work. Please fix it please.

 

<!DOCTYPE html>
<html>

<head>
    <title>Blank App Designer Packaged Web App Project Template</title>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">


    <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=no">


    <style>

        @-ms-viewport { width: 100vw ; min-zoom: 100% ; zoom: 100% ; }          @viewport { width: 100vw ; min-zoom: 100% zoom: 100% ; }
        @-ms-viewport { user-zoom: fixed ; min-zoom: 100% ; }                   @viewport { user-zoom: fixed ; min-zoom: 100% ; }

    </style>

    <link rel="stylesheet" href="css/app.css">


    <script src="cordova.js" id="xdkJScordova_"></script>

    <script src="js/app.js"></script>           <!-- for your event code, see README and file comments for details -->
    <script src="js/init-app.js"></script>      <!-- for your init code, see README and file comments for details -->
    <script src="xdk/init-dev.js"></script>     <!-- normalizes device and document ready events, see file for details -->
</head>


<body>
    
    
 <button  onclick="feedback();">Button</button>
     
        
        <script>
            
        function feedback() {
    
        var bodyText = 'write your message here';
        intel.xdk.device.sendEmail(bodyText, "amir329@icloud.com", "", true, "", "" );
       }
    </script>
            

</body>
</html>

 

0 Kudos
Emir_D_
Beginner
1,371 Views

Thank you so much Adam G. Thanks for taking your time. I really needed to get this working this was very important to me. 

here and i followed this guy on github. this helped also.. now it is working on android. https://github.com/krisrak/html5-cordova-plugin-sharing

0 Kudos
Adam_G_
New Contributor I
1,371 Views

I think we worked this out offline.  I think it was that onclick needed to be changed to onClick.

0 Kudos
Reply