I am able to check whether the device is connected to wifi with this.
public boolean isOnline() {
ConnectivityManager cm = (ConnectivityManager) activity
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo = cm.getActiveNetworkInfo();
if (netInfo != null && netInfo.isConnectedOrConnecting()) {
return true;
}
return false;
}
However, i want to check the wifi connection speed something like Ping. I want to base on this ping number to set some variables. Something like this,
public int internetspeed(){
checking...
return speed;
}
Can someone give me tutorial or example?