在没有 BES 的情况下运行 Blackberry 应用程序时出现问题

发布于 2024-08-08 21:47:10 字数 675 浏览 6 评论 0原文

我正在开发一个 Blackberry 应用程序,它使用 HttpConnections 和 InputStreams 进行大量网络工作。我一直在可以访问 BES 的环境中对其进行测试,但将仅使用无线方式对其进行演示。

对 Bold 9000 的一些初步测试表明,虽然手机的网络浏览器可以访问互联网,但我的应用程序却不能。我的理解是,BES 通常处理大部分网络逻辑,而 Blackberry 本身并不擅长于此。

我见过一些关于必须将“;interface=wifi”添加到我尝试连接的网址的参考,但是当我这样做时,逐步下载大型电影文件将在几秒钟后挂起。

是否还有其他方法可以让黑莓应用程序仅使用无线功能?我可以使用可以处理此问题的签名类吗?

编辑

看起来发生的情况是网络极有可能无法正常工作——一般套接字异常。问题是,对于大文件,我正在以 256k 的块进行许多 连接,因此对于大文件,最终会出现更多错误的问题。我真的不知道如何处理这个问题。

编辑

我使用了 Connector.open 方法的变通方法,使用具有超时选项的 .open 版本。如果特定的网络调用从未返回(这是我的问题),除了异常之外,它还会在几秒钟后重试。对于例外情况,它也会这样做。这充其量只是一个临时修复,如果有人知道提高非 BES 网络性能的方法,我很乐意听到。

I'm developing a Blackberry Application that does quite a bit of networking, using HttpConnections and InputStreams. I've been testing it in an environment where it has access to a BES, but will be demoing it with only wireless.

Some preliminary testing on a Bold 9000 shows that although the web browser of the phone can get onto the internet, my application cannot. My understanding of it is that the BES usually handles most of the logic of networking, and that the Blackberry itself isn't very good at it.

I've seen some references to having to add ";interface=wifi" to the urls I am trying to connect to, but when I do this, progressively downloading a large movie file will hang after a few seconds.

Is there anything else that can be done to get a Blackberry Application to work with just wireless? Are there signed classes I could use that could handle this?

Edit

It looks like what is going on is that there is a rare chance of the networking just not working -- General Socket Exception. The problem is that for large files, I'm doing many connections, in chunks of 256k, so for large files there's more of a problem of it erroring eventually. I'm really not sure how to handle this.

Edit

I've used a work around with my Connector.open method, using the version of .open that has a timeout option. If a particular networking call doesn't ever return, which was my problem, in addition to the Exceptions, then it retries after a few seconds. It does this for the exceptions as well. This is, at best, a temporary fix, and if anyone knows of a way to improve non BES networking performance, I'd love to hear it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

生寂 2024-08-15 21:47:10

一个简单的解决方案是检查 WiFi 覆盖状态,

public boolean GetWiFiCoverageStatus()  {
    if((WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) &&
              RadioInfo.areWAFsSupported(RadioInfo.WAF_WLAN)) {
              // this.connectionString += ";interface=wifi";
              return true;
    } else return false;           
}

这将确保仅在设备连接到接入点时才建立连接。

编辑:

您应该检查的第二件事是这个知识库条目(HTTP 413 请求实体太大)

第三补充:您是否使用了 ;deviceside=true在你的连接字符串中?如果没有 MDS 后端,您必须使用此附录来确保正常的 TCP/IP 连接

A simple solution would be to check for the WiFi Coverage Status

public boolean GetWiFiCoverageStatus()  {
    if((WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) &&
              RadioInfo.areWAFsSupported(RadioInfo.WAF_WLAN)) {
              // this.connectionString += ";interface=wifi";
              return true;
    } else return false;           
}

This would ensure that a connection is build only if the device is connected to an Access Point.

Edit:

Second thing you should check is this Knowledge Base Entry (HTTP 413 Request Entity Too Large)

Third addition: Did you use ;deviceside=true in your connection string? without a MDS backend you have to use this appendix to ensure a normal TCP/IP connection

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