模拟器中的 Blackberry BrowserField 错误

发布于 2024-12-22 06:59:45 字数 1030 浏览 0 评论 0原文

我是黑莓开发的新手,我正在尝试简单地让 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:

enter image description here

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

纵性 2024-12-29 06:59:45

通常,启用移动数据系统连接服务(又名 MDS-CS)可以解决此问题但是随 JRE 7.0.0(9930 模拟器)提供的 MDS-CS 版本不正确! BlackBerry 论坛上的原始帖子可以找到 此处

根据这篇文章:

7.0 中包含错误版本的 MDS-CS 模拟器。要更正它,您可以将其删除并从 6.0 复制版本。

从 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:

An incorrect version of MDS-CS simulator was included in 7.0. To correct it you can delete it and copy the version from 6.0.

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.

请别遗忘我 2024-12-29 06:59:45

我也遇到了同样的问题,我知道这是运行时异常,所以我建议您将其写在 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.

離人涙 2024-12-29 06:59:45

我想建议你的另一件事是,请在 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.

披肩女神 2024-12-29 06:59:45

我从你的代码中得到了浏览器屏幕;问题是:

在打开应用程序之前,有时您必须打开 Blackberry 浏览器并检查任何链接(例如:http://google. com),即使您连接了互联网设置然后运行您的应用程序。

public class StartUp extends UiApplication
{
     public static void main(String[]ali)
     {
           StartUp start=new StartUp();
           start.enterEventDispatcher();
     }
     public StartUp() 
     {  
        MainScreen screen = new MainScreen();
        BrowserField browserField = new BrowserField();;
        screen.add(browserField);
        pushScreen(screen);

        browserField.requestContent("http://www.google.com/news");
     }
}

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.

public class StartUp extends UiApplication
{
     public static void main(String[]ali)
     {
           StartUp start=new StartUp();
           start.enterEventDispatcher();
     }
     public StartUp() 
     {  
        MainScreen screen = new MainScreen();
        BrowserField browserField = new BrowserField();;
        screen.add(browserField);
        pushScreen(screen);

        browserField.requestContent("http://www.google.com/news");
     }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文