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
stefano
Posts: 51
Registered: ‎08-07-2008
My Device: Not Specified

direct tcp socket over wifi and 3g

is there a mode to know if the device is connected over wifi ? I developed an application that use a direct socket connection. At the moment there is a flag in settings of application for use the wifi connection or 3g, edge, gprs...
That is my code: 
 
        if (bWifiWay)
           sConnection = "socket://xx.xx.xx.xx:8080;DeviceSide=True;interface=wifi";
        else
           sConnection = "socket://xx.xx.xx.xx:8080;DeviceSide=True;";
 
that require a setting from input user. I'd like detect if the device is connected on network wifi or not.
Is possible ? 
 
thanks 
Please use plain text.
Developer
bikas
Posts: 984
Registered: ‎02-10-2009
My Device: Not Specified
Please use plain text.
Developer
johnbibs
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: direct tcp socket over wifi and 3g


if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED){
}
 
you can also check the network diagnostic tool which is found here:
 
 
 
Please use plain text.