Finding the wifi connection speed.
Please Login to Remove!
Hi All,
I am using blackberry 9520. I am writing an application which requires wifi connection properly working. Following is the code to check the wif connection :
********************************************
private String getWiFiUrl() {
if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) {
if (CoverageInfo.isCoverageSufficient(CoverageInfo.CO VERAGE_DIRECT,
RadioInfo.WAF_WLAN, false)) {
EventLogger.logEvent(0x4e697e68da459c1cL,
("Wifi: ").getBytes(), EventLogger.ALWAYS_LOG);
return ";deviceside=true;interface=wifi";
}
} else {
EventLogger.logEvent(0x4e697e68da459c1cL, ("NonWifi: ").getBytes(),
EventLogger.ALWAYS_LOG);
msg = "Insufficient Coverage on wifi";
}
return null;
}
********************************************
if i switch off Wifi access point, then the above code returns null. When Wifi access point is on & speed is good the my application works fine. But the problem is when access point is on & the speed is very low, then my application cannot conact to my server.
My problem is that, how I can find that the Wifi speed is perfect. Because, if the speed is perfect then only I try toconnect server, otherwise, I will give some message to user.
Please help me.
Thanks in advance.
|