2

I'm trying to use the childBrowser plugin for phonegap and it's failing to generate the .apk,

In Eclipse I can see an error (deprecated function) at:

settings.setPluginState(true);

The problem here is that both versions have this line, anyway I commented this line (with not so many hopes) but it's still failing

By failing I mean that this:

window.plugins.childBrowser.showWebPage('http://google.com/')

Is not opening any page or throwing any errors...

Any idea what I'm missing?

PD: I included the .jar, the .js (and referenced it), the lines in androidmanifest.plist and in config.xml

-EDIT-

enter image description here

Phonegap: 2.1.0
childBrowser: 2.0

-EDIT-

If waiting untill device ready then I get this error in the console's simulator:

E/Web Console(30411): Uncaught TypeError: Cannot read property 'childBrowser' of undefined at file:///android_asset/www/js/scripts.js?v=33s:883
4

3 に答える 3

3

PhoneGap 2.1 に固執する特別な要件がない限り、コマンドライン インターフェイスとバージョン 3+ を使用してください。子ブラウザー プラグインは、既定で Cordova と共に配布されるようになりました。

これは次のように簡単です。

$ cordova create hello com.example.hello HelloWorld
$ cordova platform add android
$ cordova plugin add org.apache.cordova.inappbrowser

次に、HTML をディレクトリに追加し、以下をwww使用してアプリをビルドします。

$ cordova build android

子ブラウザで URL を開くには、JavaScript で次のように呼び出します。

window.open("http://google.com/", "_blank");
于 2013-11-17T23:10:51.690 に答える