04-15-2010 09:48 AM
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
Solved! Go to Solution.
04-15-2010 10:21 AM
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.
04-16-2010 12:59 AM
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.
04-16-2010 02:37 AM
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?
04-16-2010 02:43 AM
I am using Socket connection.
String url="socket://"+Ip+":"+Port+";deviceside=true"; System.out.println("Connect::::" + url); dataSocket=(SocketConnection)Connector.open(url,Co
nnector.READ_WRITE); dataSocket.setSocketOption(SocketConnection.KEEPAL IVE,2); dataSocket.setSocketOption(SocketConnection.DELAY, 0); outdataStream = dataSocket.openOutputStream(); indataStream = dataSocket.openInputStream();
04-16-2010 04:51 AM
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
04-16-2010 05:50 AM
You solved my problem.
I just needed to add ";interface=wifi" in the connection.
Thanks and Regards