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 Contributor
Posts: 8
Registered: ‎03-28-2011
My Device: N/A
My Carrier: N/A

Connection works with Vodafone but not o2 (UK)

I have code that detects whether Wifi is available, and adds ";interface=wifi"; to my URL.

If there is no Wifi then I append ";deviceside=true".

 

This works for my Vodafone SIM, but not when I put an o2 SIM in the phone. I haven’t tested any other networks. I have searched around but can't seem to find any definite answers. 

 

What magic string do I need to add for o2 connections (and other networks) ? And how do I determine which one to use? Having come from iOS and Android development this is quite new to me Smiley Happy I am using the SDK version 5.

 

Any help much appreciated,

 

Thanks

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

Re: Connection works with Vodafone but not o2 (UK)

Using ";deviceside=true" typically, unless it is included in the "branding" of the phone, requires APN settings.  See about this in here:

http://supportforums.blackberry.com/t5/Java-Development/Different-ways-to-make-an-HTTP-or-socket-con...

 

In addition, if you have Vodafone branded OS, it will, in my experience, actually use WAP 2 unless you tell it not to, and that is what I think is happening here.  I think you have Vodafone OS on the phone, which with a Vodafone SIM gives you WAP connection when you specify ";deviceside=true".  O2 does not do the same.

 

Try the O" SIM with O" APN information specified in the TCP Options and I think that SIM will work, search Google for O2 APN settings.

New Contributor
Posts: 8
Registered: ‎03-28-2011
My Device: N/A
My Carrier: N/A

Re: Connection works with Vodafone but not o2 (UK)

[ Edited ]

Hi Peter, many thanks for your reply.,

 


The o2 phone I tested on was a customer's phone, so I assume it came with an o2 SIM and is representative of how they are usually configured. However I get the same problem when I put the o2 SIM in my phone 

 

I have read the "stickied" posts and watched the videos. I have changed my code to the following, as reccomended by the video (which is very useful, if not obvious to find!). 

ConnectionFactory factory = new ConnectionFactory();

 

int[] transportTypes = { TransportInfo.TRANSPORT_TCP_WIFI, TransportInfo.TRANSPORT_BIS_B, TransportInfo.TRANSPORT_WAP2, TransportInfo.TRANSPORT_MDS,TransportInfo.TRANSPORT_TCP_CELLULAR, TransportInfo.TRANSPORT_WAP };

 

factory.setPreferredTransportTypes(transportTypes);

 

ConnectionDescriptor connection = factory.getConnection(httpBaseURL);result = connection.getUrl();

 

// Pass result to my web service factory...


This has the effect of making everything work on Vodafone, o2 and 3. However on Orange I get a null value returned from getConnection().According to http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/io/transport/ConnectionFactory..."If no connection can be obtained, null is returned". When I try an use the web browser I get a message "This is a wi-fi service. Please ensure your device has an active wi-fi connection and try again" - I am guessing this is related?

 

Note I have yet to test on T-Mobile, idealy I would like to know of a solution that is 100% for all networks, as it is likely my app will be used around the world on lots of exotic networks and I won't be able to test on all of them.

 

Again any help much appreciated Smiley Happy


Marc

Highlighted
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Connection works with Vodafone but not o2 (UK)

Unless you have made the associated changes to support BIS-B, Which means RIM has told you how to do it), then I would pull BIS-B from the preferred list. 

 

I suspect this is your problem in that in any device that does not have WiFi on, this list will try BIS-B, and it does not have the correct connection parameters for BIS-B. 

 

I would also put MDS ahead of WIFI in the list, because if you have both MDS and WiFi, then the MDS will be routed over WiFi anyway.