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 Developer
Posts: 10
Registered: ‎06-24-2014
My Device: BlackBerry Bold 9900
My Carrier: Free
Accepted Solution

Connection problem.

[ Edited ]

Hi everybody !

I've released an application (a snapchat client). Some user repport me the following bug : they are able to use the app in wifi, but not with 3G network. I think the error is located in the following lines : 

 

if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED){
    connection = (HttpConnection) Connector.open(urlToSend + ";interface=wifi", Connector.READ_WRITE, true);
}else {
     connection = (HttpConnection) Connector.open(urlToSend + ";deviceside=true", Connector.READ_WRITE, true);
}

 

Have you an idea of what could be wrong in my ";deviceside=true" for some user ? 

 

Thanks !

Developer
Posts: 16,689
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Connection problem.

i would suggest to use connectionfactory.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Developer
Posts: 10
Registered: ‎06-24-2014
My Device: BlackBerry Bold 9900
My Carrier: Free

Re: Connection problem.

Ok, but will it solve my problem ? I'm looking for the most reliable way to do a HTTPs connection.

I'm new to blackberry sdk, so could you guide me a little more ?

Developer
Posts: 16,689
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Connection problem.

creating network connections manually is quite complicated and you have to check lots of different things, handle errors, change the routing to retry etc.

that's why BB introduced the ConnectionFactory class in 5.0, and until you have to support a lower base level: use it.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Developer
Posts: 10
Registered: ‎06-24-2014
My Device: BlackBerry Bold 9900
My Carrier: Free

Re: Connection problem.

Ok, so all my problem will be gone with this magic tool ?

Developer
Posts: 16,689
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Connection problem.

Ha, i would never promise something like that!

I just say use it. If it does not solve your issues you'll have some reading to do, check out the ConnectionTest tool and search the forums etc.
Peter and I started development a long time before 5.0, there are plenty of threads about the "olden ways" :smileyhappy:
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter