Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Member
thinkcomp
Posts: 2
Registered: ‎05-05-2010
My Device: Curve 8520

";interface=wifi" Suffix Doesn't Work

Hi,

 

I have a BlackBerry Curve 8520 T-Mobile device. It has wi-fi capability, and it works. I can surf the web with it using the BlackBerry web browser just fine. What doesn't work is using any kind of internet functionality from within my application, even though I am very clearly appending ;interface=wifi to the end of each URL. My app is code signed properly (which took a week to get right, but it finally works). There are no compile errors. I'm using JDE 4.1.0 to compile for backward compatibility purposes.

 

Question 1: What is wrong? Mike Kirkup's video says that all you need to do is add ;interface=wifi. I'm doing that. It doesn't work.

 

Question 2: If wi-fi is NOT available somewhere and the ;interface=wifi suffix string is still present, will the phone default back to BES or BIS if a data plan is active on the user's phone?

 

Question 3: Who thought of this insane mess? Why doesn't the phone just handle networking for you? iPhone does. Android does. BlackBerry is a nightmare by comparison.

 

Thanks,

 

Aaron

Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: ";interface=wifi" Suffix Doesn't Work

1. ";interface=wifi" is enough, though some people also code ";deviceside=true" for completeness.  When you say it does not work, what do you actually see?  Have you tested your code in a Simulator?  Note that no 4.1 devices were WiFi capable so you will have to run it in a later Simulator to get WiFi. 

 

2.  If you code "interface=wifi" and there is no wifi, you are toast.  Can't remember the exception thrown, but from memory one is. 

On the other hand, if you use BES and the device has WiFi, it will automatically swap to WiFi.  Same with BIS-B, but I'm guessing you don't have BIS-B. 

 

3. Not sure who is to blame, but there is general agreement that it is a mess.

 

I recommend that you review this Thread if you have not done so already.

http://supportforums.blackberry.com/t5/Java-Development/Connecting-your-BlackBerry-http-and-socket-c...

New Member
thinkcomp
Posts: 2
Registered: ‎05-05-2010
My Device: Curve 8520

Re: ";interface=wifi" Suffix Doesn't Work

Peter,

 

Thanks for the quick reply. I think the problem is actually that before it got to the HTTP request, the code (which I didn't write) was throwing an exception for being out of coverage that never actually appeared on the screen, so I didn't realize that the exception was terminating the thread.

 

I realize that the older devices don't have wi-fi, but we do want to support them anyway, and be able to use wi-fi on those that support it.

 

I'm not clear on the benefits of BIS-B. My impression from talking to someone at RIM customer service yesterday was that if a consumer has BIS, and they download our app from App World, they can use it. If they don't have BIS but use BES through an employer, they can use it. If they have wi-fi and I actually get this to work, they can use it. So why do I need to pay $2,000.00 minimum for BIS as a developer?

 

Aaron

Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: ";interface=wifi" Suffix Doesn't Work

I question the necessity to support 4.1 devices. We discontinued development on everything earlier than 4.2.1 years ago. Our "new installs" are something like +80% 4.5 and higher. 4.2.1 was a big jump (this is where the trackball devices started).

 

My advice, step up to 4.2.1 and see if your problem persists.

 

Regarding the BIS-B question, I don't understand what the customer support person told you - doesn't make sense to me.  Downloadung from BB AppWorld has nothing to do with BIS access.

 

Strictly speaking, you don't need BIS-B. You can detect the network transports and craft your parameters acccordingly. This is well-covered territory on the forum.

 

 

 

 

 

Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: ";interface=wifi" Suffix Doesn't Work

Agree with RexDoug, I think supporting 4.1 for a new development, is not required.  We actually develop in 4.2.1 and then compile in 4.2 and say we support trackball devices only (the original Pearl devices came with 4.2).  I appreciate that the 8700 can run 4.5, but we find it easier to give people a device attribute. 

 

The Connecting Thread I gave you a link to earlier, has code that will run in 4.1 (actually in 4.0) and interrogate the Service Books to determine whether the device has WiFi.  In fact, as I understand it, this is basically what CoverageInfo and the like do anyway. 

 

Agree with RexDoug too re BIS-B. App World does not mean BIS-B access from your application.  Remember the terminology though, BIS is a way of integrating with the RIM infrastructure, BIS-B is a connection method (like Direct TCP). 

Developer
EnochRoot
Posts: 41
Registered: ‎01-19-2010
My Device: 8900

Re: ";interface=wifi" Suffix Doesn't Work

3. I do not see any disadvantages in this behavior. It should not be too problematic to establish a connection via mobile network when wifi failed.

try {

    connectViaWifi();

} catch (Exception) {

    try {

         connectViaMobileNetwork();

    } catch (Exception) {

        ....

    }

}

 

In my oppinion it's an advantage. You have the possibility to decide whether the app only should try to use wifi or not. Or you can implement a user query "Wifi not available. Wanna try to use mobile network?". In most cases the use of Wifi is free, but using the mobile network results in charges.

 

I had a similar problem with using a wifi connection without success. I was connected to a router, received an IP, but the device was not reachable within the local network neither was the device able to ping other participants. I always had to use the BB browser to connect to a random site and try to ping the device again. If not reachable, repeat browsing. Perhaps this will help you.

 

Best regards.