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
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; }
What is the possible solution please . optional solution to create app to check internet quality in android is also appreciated Thanks Jitendra