模拟器中的 Blackberry BrowserField 错误
我是黑莓开发的新手,我正在尝试简单地让 BrowserField 工作。
我收到此错误消息:
尝试重新安装 JDE 等,但应用程序在运行时总是出现错误模拟器上就可以了.. 有什么想法吗?
这是我的代码:
package mypackage;
import net.rim.device.api.browser.field2.BrowserField;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.container.MainScreen;
/**
* This class extends the UiApplication class, providing a graphical user interface.
*/
public class HelloBlackBerry extends UiApplication {
private MainScreen _screen;
private BrowserField _bf2;
HelloBlackBerry()
{
_bf2 = new BrowserField();
_screen = new MainScreen();
_screen.add(_bf2);
pushScreen(_screen);
_bf2.requestContent("http://www.blackberry.com");
}
public static void main(String[] args)
{
HelloBlackBerry app = new HelloBlackBerry();
app.enterEventDispatcher();
}
}
我还没有可以测试的黑莓设备。
I am new to Blackberry development and Im trying to simple get a BrowserField working.
I get this errormessage:
Tried reinstalling JDE etc. etc. but the app always gets an error when I run it on the simulator..
Any ideas?
Here is my code:
package mypackage;
import net.rim.device.api.browser.field2.BrowserField;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.container.MainScreen;
/**
* This class extends the UiApplication class, providing a graphical user interface.
*/
public class HelloBlackBerry extends UiApplication {
private MainScreen _screen;
private BrowserField _bf2;
HelloBlackBerry()
{
_bf2 = new BrowserField();
_screen = new MainScreen();
_screen.add(_bf2);
pushScreen(_screen);
_bf2.requestContent("http://www.blackberry.com");
}
public static void main(String[] args)
{
HelloBlackBerry app = new HelloBlackBerry();
app.enterEventDispatcher();
}
}
I do not have a Blackberry device to test on yet.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
通常,启用移动数据系统连接服务(又名 MDS-CS)可以解决此问题但是随 JRE 7.0.0(9930 模拟器)提供的 MDS-CS 版本不正确! BlackBerry 论坛上的原始帖子可以找到 此处。
根据这篇文章:
从 JRE 7.0.0 中删除无效的 MDS 版本并将其替换为 JRE 6.0.0 中的版本解决了 BrowserField 问题。在重新运行应用程序之前,不要忘记关闭并重新运行模拟器。
这里是我原来答案的链接。
Normally, enabling the Mobile Data System Connection Service (aka MDS-CS) would have solved this BUT the MDS-CS version supplied with JRE 7.0.0 (9930 simulator) is incorrect! The original post on BlackBerry's forums can be found here.
According to this post:
Deleting the invalid MDS version from JRE 7.0.0 and replacing it with the one from JRE 6.0.0 fixed the BrowserField issue for me. Don't forget to close and rerun the simulator and before reruning the application.
Here is a link to my original answer.
我也遇到了同样的问题,我知道这是运行时异常,所以我建议您将其写在 try catch 块中,它似乎会起作用。
谢谢。
I too am having the same Problem and i came to know that as its the Runtime Exception so i suggest you to please write it in try catch block it seems it will work..
Thanks.
我想建议你的另一件事是,请在 Eclipse 中右键单击你的项目,然后单击“调试为...”,然后单击“调试配置”...,然后进入“模拟器”...,然后在该菜单中选择“启动移动设备”带有模拟器的数据系统连接服务...然后单击“应用”和“调试”它将起作用。
谢谢。
I want to suggest your one other thing that please rightclick on your project in eclipse and click on debug as... and in that click on debug configuration... and in that go into Simulator... and in that menu Select Launch Mobile Data System Connection Service with simulator... and there click on Apply and Debug it will work.
Thanks.
我从你的代码中得到了浏览器屏幕;问题是:
在打开应用程序之前,有时您必须打开 Blackberry 浏览器并检查任何链接(例如:http://google. com),即使您连接了互联网设置然后运行您的应用程序。
I got the Browser screen from your code; The thing is:
Before open the application some times you have to open the Blackberry browser and check any link(For Ex: http://google.com) even though you connect the internet settings and then run your application.
这是黑莓手机中的一个问题,请查看此
http://btsc.webapps.blackberry.com/btsc/microsites/search.do?cmd=displayKC&docType=kc&external Id=KB25846&sliceId=1&docTypeID=DT_SUPPORTISSUE_1_1&dialogID=1895604766&stateId=0%200%201895610037
This is a issue in blackberry please take a look into this
http://btsc.webapps.blackberry.com/btsc/microsites/search.do?cmd=displayKC&docType=kc&externalId=KB25846&sliceId=1&docTypeID=DT_SUPPORTISSUE_1_1&dialogID=1895604766&stateId=0%200%201895610037