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
Developer
rakesh86shankar
Posts: 1,003
Registered: ‎05-22-2009
My Device: Not Specified

Http Connection Issue getting Connection Descriptor Null

Hi,

 

I am using connection factory

 

    int[] preferredTransportTypes = { TransportInfo.TRANSPORT_BIS_B,
                    TransportInfo.TRANSPORT_TCP_WIFI,
                    TransportInfo.TRANSPORT_MDS, TransportInfo.TRANSPORT_WAP,
                    TransportInfo.TRANSPORT_WAP2 };
            ConnectionFactory _factory = new ConnectionFactory();
            _factory.setPreferredTransportTypes(preferredTransportTypes);
            ConnectionDescriptor connect = _factory.getConnection(loadingURL);

 

I am getting connect descriptor as null,Is this device BIS Configuration issue?Connection using legacy OS works but not with transport IO API,What could be the issue?



Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Http Connection Issue getting Connection Descriptor Null

1) Can you describe what you mean by this:

"Connection using legacy OS"

1.a) I presume you mean specifying a suffix yourself, if so, which suffix do you specify?

 

2) Can you try this without the TransportInfo.TRANSPORT_BIS_B and TransportInfo.TRANSPORT_WAP options and see if it works. 

Please use plain text.
Developer
rakesh86shankar
Posts: 1,003
Registered: ‎05-22-2009
My Device: Not Specified

Re: Http Connection Issue getting Connection Descriptor Null

[ Edited ]

Hi Peter,

 

If i make connection mechanism using >

 
Connections happens using BIS,
 
 
But if i
 
ConnectionFactory _factory = new ConnectionFactory();
            _factory.setPreferredTransportTypes( preferredTransportTypes );        
            ConnectionDescriptor con = _factory.getConnection(url);
 
 
con is always null in this case which worked earlier,
 
Inorder to avoid this sort of issue,i tried using this Blackberry API for connection factory mechanism instead of NetworkLegacy mode.Still same sort of issue happens :smileysad:
 
 
 
 
Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Http Connection Issue getting Connection Descriptor Null

Create a BisBOptions Object and use ConnectionFactory setTransportTypeOptions() to enable BisB access using ConnectionFactory.  It is not ebaled by default. 

Please use plain text.
Developer
rakesh86shankar
Posts: 1,003
Registered: ‎05-22-2009
My Device: Not Specified

Re: Http Connection Issue getting Connection Descriptor Null

I have BIS Mechanism Only,

 

I connects through WIFI,As suggested by you i had TRANSPORT_MDS,Still connection descriptor is null,BIS which worked earlier is not working now,

 

Is there anything to do with APNSettings?

 

Thanks

Rakesh

Please use plain text.
Developer
rakesh86shankar
Posts: 1,003
Registered: ‎05-22-2009
My Device: Not Specified

Re: Http Connection Issue getting Connection Descriptor Null

As suggested by you still it is coming as null.My Device is US based Verizon device with GSM/CDMA device.

 

I am using GSM in india.

 

 

	BisBOptions options = new BisBOptions(TransportInfo.getTransportTypeName(TransportInfo.TRANSPORT_BIS_B));		
			ConnectionFactory _factory = new ConnectionFactory();
			_factory.setTransportTypeOptions(TransportInfo.TRANSPORT_BIS_B, options);		
			ConnectionDescriptor con = _factory.getConnection(url);

 

Still con descriptor is null.:smileysad:

 

Thanks

Rakesh

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Http Connection Issue getting Connection Descriptor Null

[ Edited ]

Two things:

 

1) Are you 100% sure that your phone in India has BIS-B access?

As I understand some providers in India, for example Airtel, do NOT support BIS-B.  But that is just my understanding. 

 

2) If you are sure that you are using BIS-B, and it does work on your phone (you can test this using the Legacy code and making sure that it actually uses BIS-B), then probably you have just set your BisBOption incorrectly.  Have a think about how it might be set and what you need to specify. 

 

Personally I am not convinced that you are using BIS-B when you are trying the Alternative Network approach.  So convince yourself - debug that processing to make sure that you are. 

Please use plain text.
Developer
rakesh86shankar
Posts: 1,003
Registered: ‎05-22-2009
My Device: Not Specified

Re: Http Connection Issue getting Connection Descriptor Null

[ Edited ]

1)Vodafone is service provider i use .FB,Twitter applications  are getting connected.

2)I tried accessing thr Legacy Code sample

(Network Diagnostic tool application)
-----------------------------------------------------------
Network:Vodafone IN

NetworkType Type:CDMA

Network Services:smileyvery-happy:ata+EVDO+Voice

Device:9930 - 7.1.0.1066

While clicking Available Transports button- I am getting BIS coverage and service available


If click the run button

 

(BIS-B)(HTTP GET) is successful.

and in url i am getting ----->"http://www.google.com.ca:80/;deviceside=false;ConnectionType=body

 

In Network API Demo:

---------------------------------------

On Clicking "Transport Info" button

in Availablity and Coverage BISB option are checked which is available

On Clicking "Connection Test" button

 

and in the "shows option" click


In the end if the screen ,There is BIsB option in the next line there is

BisB Options[mandatory for BisB]
connection type:


What should i specify in connection type--?

Is this anyway related to BisB option incorrect that you were specifying about?

-------------------------------------------------------------------------------------------------------------

 

What is standard way of making connection for 5.0 above ?


I want to know,this is correct implementation of Transport mechanism?

ConnectionFactory _factory = new ConnectionFactory();
_factory.setPreferredTransportTypes( preferredTransportTypes );        
ConnectionDescriptor con = _factory.getConnection(smsurl);
if(con!=null){
//Connectivity is available
Connection connect = con.getConnection();            
request = (HttpsConnection)connect;
System.out.println("Requested URL is>>>>>"+request.getURL());
else
//Connectivity is Down
}

 



So My assumption is it will take working connection mechanism,based upon on the priority,which gives connectionDescriptor

Please use plain text.
Developer
rakesh86shankar
Posts: 1,003
Registered: ‎05-22-2009
My Device: Not Specified

Re: Http Connection Issue getting Connection Descriptor Null

exact url of networking diagonostic tool cannot be posted because of the forum not allowing xxx public

 

and in url i am getting ----->"http://www.google.com.ca:80/;deviceside=false;ConnectionType=xxxxxpublic

 

Hope it clears you peter

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Http Connection Issue getting Connection Descriptor Null

In that case you need to play with your BisBOption specification. 

Please use plain text.