Skip to content

Instantly share code, notes, and snippets.

@macdonst
Created May 26, 2011 16:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save macdonst/ffb9651d04155e4f442f to your computer and use it in GitHub Desktop.
Save macdonst/ffb9651d04155e4f442f to your computer and use it in GitHub Desktop.
Example of how to use the ChildBrowser in Android
<!DOCTYPE html >
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no" />
<meta name="format-detection" content="telephone=yes" />
<title>Test App</title>
<script type="text/javascript" charset="utf-8" src="phonegap.0.9.5.js"></script>
<script type="text/javascript" charset="utf-8" src="childbrowser.js"></script>
<script language="text/javascript" type="text/javascript">
/**
* Called when initial web page is loaded
*/
function onBodyLoad()
{
console.log("onBodyLoad()");
// Listen for PhoneGap framework to finish init
document.addEventListener("deviceready",onDeviceReady,false);
}
/**
* When this function is called, PhoneGap has been initialized and is ready to roll
*/
function onDeviceReady() {
console.log("onDeviceReady()");
}
</script>
</head>
<body onload="onBodyLoad();">
<a href="#" onclick="window.plugins.childBrowser.showWebPage('http://www.google.com');">Open Google.com in child browser</a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment