facebookarchive / network-connection-class

Listen to current network traffic in the app and categorize the quality of the network.
Other
3.18k stars 515 forks source link

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

Open kumarjitendra opened 7 years ago

kumarjitendra commented 7 years ago

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