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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Contributor
casebash
Posts: 18
Registered: ‎03-01-2010
My Carrier: NOne

Displaying a Wifi Indicator in the Titlebar

I would like to display a wifi indicator in the titlebar similar to the browser app. Is there a function/setting to do this?

Please use plain text.
Developer
JCarty
Posts: 1,055
Registered: ‎01-25-2009

Re: Displaying a Wifi Indicator in the Titlebar

[ Edited ]

 

You may have to "fake" this in your own application. You could use the following code to see if its on or not:

 

if(CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_CARRIER,RadioInfo.WAF_WLAN, false)){
coverageWiFi = true;
wifiLog.addlog("Coverage Status: Online");

}

 

If WIFI is turned on, you then show your icon, if it isn't then don't show it.

 

Get your logo here:

 

http://www.allfreelogo.com/logo/wifi-logo.html

 

Source: http://supportforums.blackberry.com/t5/Java-Development/How-to-identify-whether-wifi-connection-is-c...

Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Please use plain text.
Contributor
casebash
Posts: 18
Registered: ‎03-01-2010
My Carrier: NOne

Re: Displaying a Wifi Indicator in the Titlebar

[ Edited ]

That won't work for updating the logo, but looking at the docs I see that you can add a listener. Thanks for the link to the logo. All free logos is a horrible site though, its as though their site designer was given the challenge to cover every inch in ads. I still need to figure out how to add an image to the right side of the field. Will read more docs.

Please use plain text.
Developer
Posts: 1,474
Registered: ‎04-14-2009

Re: Displaying a Wifi Indicator in the Titlebar

[ Edited ]

As far as I know, CoverageInfo.COVERAGE_CARRIER has alsmost nothing to do with pure Wi-Fi coverage. CoverageInfo.COVERAGE_CARRIER is set in the Wi-Fi case only after the OS tests the Wi-Fi network and establishes some secret property (probably that the gateway IP address and port(s) specified in the Wi-Fi TCP/IP Transport/Browser Service Book records are reachable). You can see that CoverageInfo.COVERAGE_CARRIER is never set if you connect to a private WLAN having no Internet access, however, your app will still be able to access hosts reachable from that WLAN.

 

The proper check is to query WLANInfo.getWLANState(). You could also query whether the WLAN interface is enabled or not (doesn't mean it's connected to an AP) using the RadioInfo class. Last but not least, you can subscribe to changes in WLANInfo.getWLANState() using WLANInfo.addListener().

Please use plain text.