Here is my code:
<script src="include/cordova.js" type="text/javascript"></script>
<script src="include/sencha-touch-all.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" src="include/childbrowser.js"></script>
<link href="include/sencha-touch.css" rel="stylesheet" type="text/css" />
var childBrowser = null;
if (navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/)) {
document.addEventListener("deviceready", onDeviceReady, false);
} else {
onDeviceReady();
}
function onDeviceReady(){
console.log("PhoneGap is Ready");
childBrowser = ChildBrowser.install();
}
function openChildBrowser(url)
{
try {
//both of these should work...
var cb = new ChildBrowser();
console.log(cb);
cb.showWebPage('http://www.google.com');
}
catch (err)
{
alert(err);
console.log(err);
}
}
…
There is some more code that is unrelated but when I call openChildBrowser() I receive the following error:
Uncaught TypeError: Object #<Object> has no method 'exec'
Which I believe is in reference to childbrowser calling exec on the cordova object.
When I look at the cordvoa object I don’t see an exec function anywhere…
Any ideas?
I ended up starting over and using Eclipse and the Phonegap SDK. Was able to get this working that way without using the build service.
This might help some people:
http://phonegap.com/start#android
https://github.com/phonegap/phonegap-plugins/tree/master/Android/ChildBrowser