facebookarchive/network-connection-class

method "mapBandwidthQuality" doesn't receive any argument in double average

kumarjitendra opened this issue · 0 comments

Hello,
I have to develop an android application to check internet quality like speed, ping , jitter
I am using this library. when i run my application i always get first return . It means double average is not having any values so loop is not executing.
For Example :
case 1. output "Negative"

private ConnectionQuality mapBandwidthQuality(double average) {
if (average < 0) {
return ConnectionQuality.NEGATIVE;
}
if (average < DEFAULT_POOR_BANDWIDTH) {
return ConnectionQuality.POOR;
}
if (average < DEFAULT_MODERATE_BANDWIDTH) {
return ConnectionQuality.MODERATE;
}
if (average < DEFAULT_GOOD_BANDWIDTH) {
return ConnectionQuality.GOOD;
}
return ConnectionQuality.EXCELLENT;
}

case 2. output "GOOD"

private ConnectionQuality mapBandwidthQuality(double average) {
if (average < DEFAULT_GOOD_BANDWIDTH) {
return ConnectionQuality.GOOD;
}
if (average < 0) {
return ConnectionQuality.NEGATIVE;
}
if (average < DEFAULT_POOR_BANDWIDTH) {
return ConnectionQuality.POOR;
}
if (average < DEFAULT_MODERATE_BANDWIDTH) {
return ConnectionQuality.MODERATE;
}

    return ConnectionQuality.EXCELLENT;
}

What is the possible solution please .
optional solution to create app to check internet quality in android is also appreciated
Thanks
Jitendra