02-23-2012 07:36 AM
Hi,
I have an app that is using HttConnection with the plain URL (no parameters added) and it is working just fine for all BB devices up to devices running BB OS 7.
Question 1: What has been changed in BB OS 7 since this does not work anymore?
To solve this I tried using the TransportDetective and URLFactory from the NetworkAPIAlternative project (http://supportforums.blackberry.com/t5/Java-Develo
And added the following code to add right parameters to the URL before creating the HttpConnection:
TransportDetective td = new TransportDetective(); URLFactory urlFactory = new URLFactory(gatewayURL); if(td.isCoverageAvailable(TransportDetective.TRANSPORT_MDS)){ //Use MDS if available gatewayURL = urlFactory.getHttpWap2Url(td.getSrMds()); } else if(td.isCoverageAvailable(TransportDetective.TRANS PORT_BIS_B)){ //Use BIS-B if available gatewayURL = urlFactory.getHttpWap2Url(td.getBisServiceRecord() ); } else if (td.isDefaultTcpCellularServiceRecordAvailable()){ //Use default TCP Celluar Service if available (APN) gatewayURL = urlFactory.getHttpWap2Url(td.getDefaultTcpCellular ServiceRecord()); } else if(td.isCoverageAvailable(TransportDetective.TRANS PORT_TCP_WIFI)){ //Use TCP WIFI if available gatewayURL = urlFactory.getHttpWap2Url(td.getTcpWiFiServiceReco rd()); } else if(td.isCoverageAvailable(TransportDetective.TRANS PORT_WAP2)){ //Use WAP 2 if available gatewayURL = urlFactory.getHttpWap2Url(td.getWap2ServiceRecord( )); } else if(td.isCoverageAvailable(TransportDetective.TRANS PORT_WAP)){ //Use WAP 1 if available gatewayURL = urlFactory.getHttpWap2Url(td.getWapServiceRecord() ); }
Still it does not work. If I set it to just use TRANSPORT_WAP2 it will work on BB OS 7, but only if the WiFI is enabled. The app should be able to use the network with all available transport types (BES/BIS/WiFI++).
Any suggestions on how I could make this work?
Best regards,
Per Ola
02-23-2012 07:48 AM
02-23-2012 08:25 AM
ConnectionFactory will simplify this for you if you are using OS 5.0 and above.
If you have to support previous OS's, then the approach you are using should work.
A few thoughts:
You say:
"I have an app that is using HttConnection with the plain URL (no parameters added) and it is working just fine for all BB devices up to devices running BB OS 7"
You have been lucky! I don't think this would be the case for many people.
You say
"If I set it to just use TRANSPORT_WAP2 it will work on BB OS 7, but only if the WiFI is enabled."
I would say this is unusual and in fact I would report this as a bug. But all OS 7.0 + devices I have tested work fine on WiFi, but only if the ";interface=wifi" is specified. I would 100% confirm you are specifying the WAP connection string and I would turn mobile off on device to prove this is actually what you are seeing.
Is there any reason why you don''t try WiFi before the other services. I would put it before everything except MDS.
If you haven't specified the extra parameter, then BIS-B will not work.
02-23-2012 09:06 AM - edited 02-23-2012 09:08 AM
Thank you for the reply simon_hain.
I need to support devices running on BB OS earlier than 5.0 so that kinda removes the option you suggested. If I can't make it work for all devices I might go back to try this.
Best regards,
Per Ola
02-23-2012 01:00 PM
Hi peter_strange,
Thank you for the detailed reply, much appreciated.
You might be right that I have just been lucky when running with no parameters in the URL.
I tried again witht he WAP 2 transport and I was wrong. If I have WiFI enabled and disable the mobile then it does not work.
I changed the arangement of transport types so I am now trying:
Running on a BB OS 6 device this works great with only mobile on, only wifi on and a combination of both.
Running on a BB OS 7 device it works with only wifi on, and a combination of wifi and mobile. But it does not work if I only have mobile on. With only mobile on I am able to surf with the browser and use apps like twitter and facebook so the mobile connection should be just fine.
Do you why it does not work on BB OS 7 when WiFi is disabled and mobile is on?
Best regards,
Per Ola
02-23-2012 02:46 PM
In the absence of other information, my theory would be that the Browser and Twitter and Facebook, all RIM written, use BIS-B. As I mentioned previously, BIS-B needs a special parameter which you have to ask for or get by using PUSH for your application, see:
In addition, you need to be aware that the working or not of the various connection methods is more typically a result of the carrier and plan rather than OS. In the first instance I would investigate other factors for the difference you see between OS 7 and OS 6 rather than the OS level.
Unfortunately I think the next course of action is to try out the network diagnostic tool. I think you know where it is, but just in case, look for the attachments here:
02-28-2012 09:16 AM
Hi peter_strange,
Thanx a lot for the effort I see you put down in this forum and other places.
Your theory that the various connection issues was rather a result of the carrier and plan then the OS seems to be correct. I tried to switch the SIM-card between the OS 7 and OS 6 device and then it works just fine for the OS 7 device. The strange thing is that it also works fine with the OS 6 device (now using the SIM-card where mobile data did not work in the OS 7 device).
As you have probably understood I am getting a bit confused by the different BB network capabilites but after some reading and help from you I am starting to get there ![]()
I will look closer in to the BIS-B connection. I understand that this must be granted by BlackBerry Alliance for each app developed...
I might also run the network diagnostic tool to try to see why the OS 6 and OS 7 device behaves different even when using the same SIM-card.
Thanks a lot,
Per Ola
02-28-2012 09:22 AM
02-29-2012 06:47 AM
Is it possible to skip BIS-B (push) support and still be guarantied that it will work with all different carries/data plans?
Using this logic:
TransportDetective td = new TransportDetective(); URLFactory urlFactory = new URLFactory(gatewayURL); if(td.isCoverageAvailable(TransportDetective.TRANSPORT_MDS)){ //Use MDS if available gatewayURL = urlFactory.getHttpWap2Url(td.getSrMds()); } else if(td.isCoverageAvailable(TransportDetective.TRANS PORT_TCP_WIFI)){ //Use TCP WIFI if available gatewayURL = urlFactory.getHttpWap2Url(td.getTcpWiFiServiceReco rd()); } else if (td.isDefaultTcpCellularServiceRecordAvailable()){ //Use default TCP Celluar Service if available (APN) gatewayURL = urlFactory.getHttpWap2Url(td.getDefaultTcpCellular ServiceRecord()); } else if(td.isCoverageAvailable(TransportDetective.TRANS PORT_WAP2)){ //Use WAP 2 if available gatewayURL = urlFactory.getHttpWap2Url(td.getWap2ServiceRecord( )); } else if(td.isCoverageAvailable(TransportDetective.TRANS PORT_WAP)){ //Use WAP 1 if available gatewayURL = urlFactory.getHttpWap2Url(td.getWapServiceRecord() ); }
We are already using a framework for communication which is using the HttpConnection. Looks like I would have to do quite a lot to use BIS push...
Cheers,
Per Ola
02-29-2012 06:54 AM