Skip to content Skip to sidebar Skip to footer

Launchexternal Doesn't Work On Xdk App On Android

I have an application that was developed in XDK. The app links to an external web site at one point (for a PDF actually). I've tried both window.open(url,'_system') and intel.xdk.d

Solution 1:

In order to use intel.xdk.device.launchExternal(url), you are required to include the Device plugin under the Intel XDK Plugins group on the Projects Panel > Cordova 3.X Hybrid Mobile App Settings > Included Plugins > Featured & Custom Cordova Plugins > Device.

In order to use window.open(url,"_system") to open a URL leveraging the Cordova inAppBrowser plugin, you are required to include the In App Browser plugin on the Projects Panel > Cordova 3.X Hybrid Mobile App Settings > Included Plugins > Standard Cordova Plugins > In App Browser.

<!DOCTYPE html><!--HTML5 doctype--><html><head><title>Your New Application</title><metahttp-equiv="Content-type"content="text/html; charset=utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" /><styletype="text/css">/* Prevent copy paste for all elements except text fields */
        *  { -webkit-user-select:none; -webkit-tap-highlight-color:rgba(255, 255, 255, 0); }
        input, textarea  { -webkit-user-select:text; }
        body { background-color:white; color:black }
    </style><scriptsrc='intelxdk.js'></script><scriptsrc='cordova.js'></script><scriptsrc='xhr.js'></script><scripttype="text/javascript">var onDeviceReady=function(){                             // called when Cordova is readyif( window.Cordova && navigator.splashscreen ) {     // Cordova API detected
                navigator.splashscreen.hide() ;                 // hide splash screen
            }
        } ;
        document.addEventListener("deviceready", onDeviceReady, false) ;
    </script></head><body><!-- content goes here--><h2>Hello World</h2><script>functionopenExternal(elem) {
            window.open(elem.href, "_system");
            returnfalse; // Prevent execution of the default onClick handler 
        }
    </script><ahref="https://www.twitter.com"onClick="javascript:return openExternal(this)">Twitter</a></body></html>

Solution 2:

Please note that intel.xdk.device.launchExternal has now been deprecated. Use the default inappbrowser APi like this: window.open("market://details?id=","_blank","location=no")

Post a Comment for "Launchexternal Doesn't Work On Xdk App On Android"