OpenAllWhitelistURLsInWebView for Android in Cordoba / Telephony

I am working on an application that will handle some device-specific things, but then redirect the user to an online page. All of this works well in iOS build, and I'm trying to get it to work on Android.

The Android app is currently loading, but does nothing if I have a call window.location.href = ...in window.onload. One of the options needed for iOS was OpenAllWhitelistURLsInWebView. Are there any similar settings for Android? How do you install it? Any other recommendations?

+5
source share
2 answers

... Phonegap , ...

,

<!DOCTYPE HTML>
<html>
<head>
<title>Index Page</title>

<!-- Adding viewport -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Adding Phonegap scripts -->
<script type="text/javascript" charset="utf-8"
src="cordova/cordova-1.5.0.js"></script>

<!-- Adding jQuery mobile and jQuery scripts & CSS -->
<script type="text/javascript" src="jquery/jquery-1.7.1.min.js"></script>
<link rel="stylesheet"
href="jquerymobile/jquery.mobile-1.1.0-rc.1.min.css" />
<script type="text/javascript"
src="jquerymobile/jquery.mobile-1.1.0-rc.1.min.js"></script>

<script type="text/javascript">

function onLoad() {
    document.addEventListener("deviceready", onDeviceReady, false);
}

function onDeviceReady() {

$.ajax({
    type : 'GET',
    cache : false,
    url : "http://192.168.1.198:9051/something.xml"
            + "?time=" + Date.now(),
    data : {
        key : "value"
    },
    dataType : "xml",
    success : function(xml) {
        console.log("Success Page1");
    },
    error : function(xhr) {

    }
});
}
</script>

iOS... , , ExternalHosts cordova.plist

Android. . - ..:)

0
<access origin="www.google.com"/>

res/xml/config.xml.

0

All Articles