I'm writing up a quick tutorial on how to get the ChildBrowser plugin for PhoneGap Android installed as a few folks on the mailing list are having troubles getting it going. First lets start off with a stock PhoneGap Android project in Eclipse:
Step one is to create the directory structure for the ChildBrowser.java file. Click on the src folder then right mouse click or control click on the folder. From the popup menu select New and Package.
In the dialog box that appears type in com.phonegap.plugins.childBrowser then click the Finish button. Please note the package name is case sensitive so make sure it matches exactly.
Step two is adding the ChildBrowser.java class to your project. Download the file from this link and save it in your projects src/com/phonegap/plugins/childBrowser directory. Then click on you projects name then right mouse click and select Refresh. Your project explorer should now look like this:
Step three is to add the childbrowser.js file to your project. Download the file from this link and save it in your projects assets/www directory. Then click on you projects name then right mouse click and select Refresh. Your project explorer should now look like this:
In step four we will need to modify the AndroidManifest.xml file to add an intent filter for the ChildBrowser. Paste the following lines inside the <application/> tag:
<activity android:name="com.phonegap.DroidGap" android:label="@string/app_name">
Here is a gist of what my AndroidManifest.xml looks like.
In step five we need to modify our index.html file to a reference the childbrowser.js and call the ChildBrowser. In the <head/> tag after the reference to phonegap.0.9.5.js add the following line:
and somewhere in your <body/> tag add a line like this:
<a href="#" onclick="window.plugins.childBrowser.showWebPage('http://www.google.com');">Open Google.com in child browser</a>
This will give you an app that shows you this:
and opens Google in the ChildBrowser when you click on the link.
The full gist of my index.html is available as well.
Hope this helps everyone!