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
Contributor
Posts: 45
Registered: ‎11-10-2010
My Device: Not Specified

Socket connection works in simulator but not on the mobile phone of blackberry 9320

Socket connection works in simulator but not on the mobile phone of blackberry 9320.

 

Application send the data to our server from simulator but the same application not works in the Blackberry 9320.

 

we got the socket connection time out exception.

Developer
Posts: 543
Registered: ‎12-23-2010
My Device: Z10
My Carrier: Airtel

Re: Socket connection works in simulator but not on the mobile phone of blackberry 9320

Are you adding proper connection suffix?

Contributor
Posts: 45
Registered: ‎11-10-2010
My Device: Not Specified

Re: Socket connection works in simulator but not on the mobile phone of blackberry 9320

Thanks for the reply...

  

 

 String url = "socket://***.**.***.****:54321;deviceside=true";

 

I am using above like for the socket connection. The simulator 9320 send the data to the server but the device 9320

not sending the data to the server.

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

Re: Socket connection works in simulator but not on the mobile phone of blackberry 9320

There is a lot to getting networking going on device. I suggest you start here:

 

http://supportforums.blackberry.com/t5/Java-Development/Networking-Transports-II/ta-p/446742

 

and look at this:

 

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

 

If you stick with "deviceside=true", you will have to code APN information on your device and it will never use WiFi. 

 

If you want something that automatically tries t manage this for you, then look at ConnectionFactory API.

 

There are also plenty of Threads on the forum, a lot similar  to this, form people who have struggled to get networking going on device.  Search these. 

 

Good luck

Contributor
Posts: 45
Registered: ‎11-10-2010
My Device: Not Specified

Re: Socket connection works in simulator but not on the mobile phone of blackberry 9320

In the Mobile phone MDS is activated so now i ran the same application in the device blackberry 9320

i got the Socket Connection Time Out Exception.

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

Re: Socket connection works in simulator but not on the mobile phone of blackberry 9320

Are you using ";deviceside=false" to force MDS use?

Super Contributor
Posts: 253
Registered: ‎08-19-2010
My Device: BB10, Playbook, 9900, 9800, 9700, 9550, 9530, 9500, 8700.
My Carrier: TT

Re: Socket connection works in simulator but not on the mobile phone of blackberry 9320

Share my code :

 

String url = "socket://" + _screen.getHostFieldText() + ":" + serverport + (_screen.isDirectTCP() ? ";interface=wifi" : "");

 

Hopefully, the code will help you out.

 

 

-Fight with BB10
Contributor
Posts: 45
Registered: ‎11-10-2010
My Device: Not Specified

Re: Socket connection works in simulator but not on the mobile phone of blackberry 9320

I have used the following line 

String url = "socket://182.18.152.247:54321;deviceside=false";

but it is also not working still get the Exception:Time out of socket connection