Problem running Blackberry App without BES

496 views Asked by At

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.

1

There are 1 answers

1
Henrik P. Hessel On

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