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
Posts: 468
Registered: ‎08-07-2009
My Device: Curve, Bold, Storm
My Carrier: Blackberry Developer
Accepted Solution

Connection Problem via WiFi

Hi all,

 

I am having a blackberry curve mobile. When i connect my application via wifi then i am able to connect to the server but i m not able to send or recieve any data after that.

And i am also able to browse websites so there are no problems with the wifi connection.

 

So please help me what is happening.

 

Thanks and Regards

Ekansh

 

 

----------------------------------------------------------
feel free to press the kudos button on the left side to thank the user that helped you.
please mark posts as solved if you found a solution.
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Connection Problem via WiFi

Are you sure that the Browser is using WiFi?  Have you turned wireless off for example?

 

What exceptions are you getting?  What connection string did you use to connect.  Are you sure that your connection has succeeded - getting through the open is not a guarantee.  What was your code doing when it failed. 

Developer
Posts: 468
Registered: ‎08-07-2009
My Device: Curve, Bold, Storm
My Carrier: Blackberry Developer

Re: Connection Problem via WiFi

Hi Peter,

 

Thanks for the reply.

 

Yes, my browser is using WiFi. I also checked it by disabling WiFi.

 

I am also not getting any exception.

 

It works fine on simulator.

And also it works fine when it uses GPRS of the Sim inserted in device.

 

 

----------------------------------------------------------
feel free to press the kudos button on the left side to thank the user that helped you.
please mark posts as solved if you found a solution.
Developer
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: Connection Problem via WiFi

what is the connection string you are appending to your URL for wifi connection?

can you post your code that is handling the wifi connection?

Thanks and Regards,
PraveenGoparaju.
Developer
Posts: 468
Registered: ‎08-07-2009
My Device: Curve, Bold, Storm
My Carrier: Blackberry Developer

Re: Connection Problem via WiFi

Hi Blac,

 

I am using Socket connection.

 

 

 

String url="socket://"+Ip+":"+Port+";deviceside=true";
System.out.println("Connect::::" + url);
 dataSocket=(SocketConnection)Connector.open(url,Connector.READ_WRITE);
 dataSocket.setSocketOption(SocketConnection.KEEPALIVE,2); 
 dataSocket.setSocketOption(SocketConnection.DELAY,0);
 outdataStream = dataSocket.openOutputStream();
 indataStream = dataSocket.openInputStream();

 

 

----------------------------------------------------------
feel free to press the kudos button on the left side to thank the user that helped you.
please mark posts as solved if you found a solution.
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Connection Problem via WiFi

Your code is not using WiFi.

 

You need to specify ";interface=wifi" as the connection suffix to use WiFi. 

 

Please review this KB article for more information on how to set the connection suffix.

 

What Is - Different ways to make an HTTP or socket connection

Article Number: DB-00396

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is...

Developer
Posts: 468
Registered: ‎08-07-2009
My Device: Curve, Bold, Storm
My Carrier: Blackberry Developer

Re: Connection Problem via WiFi

Hi Peter,

 

Thank you.

You solved my problem.

 

I just needed to add ";interface=wifi" in the connection.

 

 

Thanks and Regards

Ekansh Srivastava

 

----------------------------------------------------------
feel free to press the kudos button on the left side to thank the user that helped you.
please mark posts as solved if you found a solution.
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Connection Problem via WiFi

Good oh, can you mark this as Solved then?