Software Archive
Read-only legacy content
17060 Discussions

Use Intel XDK as a normal webView?

Slavi_I_
Beginner
513 Views

Hello,

I was wondering is it possible to load a webpage with the XDK, not with opening the native browser but in the main view, without any address bars and etc. (fullscreen), just like a native webview? I know it will not be as fast as having all the files locally storaged but I want to check how fast it would be.

Thnk you.

0 Kudos
3 Replies
Rakshith_K_Intel
Employee
513 Views

You can use window.location to load any webpage:

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=no">
    <script src="cordova.js"></script>
</head>
<body>
    <script>
        window.location = "http://www.intel.com";
    </script>    
</body>
</html>

The above code will work, but if there is connection lost when loading website, the app might end up with blank page, and you may have to kill app and reload, here is a better way of opening website in cordova app, it uses connection and in-app browser cordova plugins to do checks before loading website and handles connection loss cases. https://github.com/krisrak/html5-cordova-webapp

0 Kudos
Slavi_I_
Beginner
513 Views

Thank you. Very nice solution !

0 Kudos
Sohel_R_
Beginner
513 Views

i want make a ebook app which app first time the pdf dawnload from server and the pdf load in memory and scound time when i want to show that then the pdf open from memory.

0 Kudos
Reply