Android上的PhoneGap Childbrowser? [英] Childbrowser with phonegap on Android?
问题描述
我不能让childbrowser在Android上工作。
我按照说明书上:的https://github.com/brycecurtis/phonegap-plugins/tree/master/Android/ChildBrowser/
我已经安装了Eclipse和所有编译需要其他的东西
应用程序,所有的作品,因为它应该。
它是在模拟器中运行,我也可以创建一个apk文件。
所以现在我试图让childbrowser工作,如下图所示。
- 我增加了childbrowser.java文件中我的工作区/ APPNAME /
SRC / COM / PhoneGap的/插件/ childBrowser /文件夹。 - 在我的工作区/应用程序的名字/资产/ WWW的childbrowser.js文件/
夹。 - 我已经联系到phonegap.0.9.4.js和childBrowser.js
文件在我的索引文件。 - 我添加了这个清单文件
> <活动机器人:名字=com.phonegap.DroidGap
>机器人:标签=@字符串/ APP_NAME>
> &所述;意图滤光器>
> &所述; /意图滤光器>
> < /活性GT;
块引用>
- 应打开childbrowser链接看起来是这样的:
< A HREF =#的onClick =window.plugins.childBrowser.showWebPage(thewebpage.html);>开放< / A>
块引用>和它仍然不能正常工作?我只是在模拟器中进行测试,因为我没有Android手机现在在这里,是不是childbrowser在模拟器中工作吗?
或有我错过了什么东西?
谢谢你。解决方案我用phonegap.0.9.4.js以及,它是为我工作。 PhoneGap的JS抛出事件deviceready后childBrowser应该工作。所以我增加了以下code。
VAR URL =http://www.google.comdocument.addEventListener(deviceready,onDeviceReady,FALSE);功能onDeviceReady(){
window.plugins.childBrowser.showWebPage(URL);
}一些技巧,因为我遇到的一些问题,以及:
- 我下载JavaScript文件是childbrowser.js,全部小写,不childBrowser.js
- 确保该ChildBrowser.java在正确的文件夹编译。检查日食bin文件夹
- 对于外部网页,使用http://在前面
- JavaScript的是Android和iPhone不同。例如在Android上,你不叫ChildBrowser.install();因此,例如code也是为iPhone / Android版/黑莓
不同I can't get the childbrowser to work on Android. I have followed the instructions on: https://github.com/brycecurtis/phonegap-plugins/tree/master/Android/ChildBrowser/
I have installed Eclipse and all the other stuff needed to compile an app and all works as it should. It is running in the emulator and I can also create an apk file.
So now I'm trying to get the childbrowser to work, like below.
- I added the childbrowser.java file in my workspace/appname/ src/com/phonegap/plugins/childBrowser/ folder.
- And the childbrowser.js file in my workspace/appname/assets/www/ folder.
- I have linked to the phonegap.0.9.4.js and the childBrowser.js files in my index file.
- I added this in the manifest file
> <activity android:name="com.phonegap.DroidGap" > android:label="@string/app_name"> > <intent-filter> > </intent-filter> > </activity>
- The link that should open the childbrowser looks like this:
<a href="#" onClick="window.plugins.childBrowser.showWebPage("thewebpage.html");">Open</a>
And it still isn't working? I'm just testing in the emulator as I don't have a android phone here right now, isn't the childbrowser working in the emulator? Or have I missed something else? Thanks.
解决方案I use phonegap.0.9.4.js as well and it is working for me. The childBrowser should work after PhoneGap JS throws event 'deviceready'. So I added the following code.
var url="http://www.google.com"; document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { window.plugins.childBrowser.showWebPage(url); }
Some tips, as I encountered some issues as well:
- The javascript file I downloaded is childbrowser.js, all lowercase, not childBrowser.js
- Make sure that ChildBrowser.java is compiled in the correct folder. Check eclipse bin folder
- For an external web page use http:// in front.
- The Javascript is a different for Android and iPhone. For example on Android you do not call ChildBrowser.install(); So example code is also different for iPhone/Android/BlackBerry
这篇关于Android上的PhoneGap Childbrowser?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!